public void Default () { DirectoryServicesPermissionAttribute a = new DirectoryServicesPermissionAttribute (SecurityAction.Assert); Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId"); Assert.IsFalse (a.Unrestricted, "Unrestricted"); Assert.AreEqual ("*", a.Path, "Path"); Assert.AreEqual (DirectoryServicesPermissionAccess.Browse, a.PermissionAccess, "PermissionAccess"); DirectoryServicesPermission sp = (DirectoryServicesPermission)a.CreatePermission (); Assert.IsFalse (sp.IsUnrestricted (), "IsUnrestricted"); }
public void Unrestricted () { DirectoryServicesPermissionAttribute a = new DirectoryServicesPermissionAttribute (SecurityAction.Assert); a.Unrestricted = true; DirectoryServicesPermission wp = (DirectoryServicesPermission)a.CreatePermission (); Assert.IsTrue (wp.IsUnrestricted (), "IsUnrestricted"); Assert.AreEqual ("*", a.Path, "Path"); Assert.AreEqual (DirectoryServicesPermissionAccess.Browse, a.PermissionAccess, "PermissionAccess"); a.Unrestricted = false; wp = (DirectoryServicesPermission)a.CreatePermission (); Assert.IsFalse (wp.IsUnrestricted (), "!IsUnrestricted"); }