public void PurgeAccessControl(SecurityIdentifier sid) { ArgumentNullException.ThrowIfNull(sid); if (DiscretionaryAcl != null) { DiscretionaryAcl.Purge(sid); } }
public void PurgeAccessControl(SecurityIdentifier sid) { if (sid == null) { throw new ArgumentNullException(nameof(sid)); } if (DiscretionaryAcl != null) { DiscretionaryAcl.Purge(sid); } }
public void PurgeAccessControl(SecurityIdentifier sid) { if (sid == null) { throw new ArgumentNullException("sid"); } Contract.EndContractBlock(); if (DiscretionaryAcl != null) { DiscretionaryAcl.Purge(sid); } }
public void DetectsCanonicalMergesAndRemovesInheritedAces () { SecurityIdentifier sid = new SecurityIdentifier (WellKnownSidType.BuiltinUsersSid, null); RawAcl acl = MakeRawAcl(new GenericAce[] { new CommonAce (AceFlags.None, AceQualifier.AccessDenied, 4, sid, false, null), new CommonAce (AceFlags.None, AceQualifier.AccessDenied, 8, sid, false, null), new CommonAce (AceFlags.None, AceQualifier.AccessAllowed, 1, sid, false, null), new CommonAce (AceFlags.None, AceQualifier.AccessAllowed, 2, sid, false, null), new CommonAce (AceFlags.Inherited, AceQualifier.AccessAllowed, 4, sid, false, null), new CommonAce (AceFlags.Inherited, AceQualifier.AccessAllowed, 4, sid, false, null) }); Assert.AreEqual (6, acl.Count); DiscretionaryAcl dacl = new DiscretionaryAcl (false, false, acl); Assert.IsTrue (dacl.IsCanonical); Assert.AreEqual (4, dacl.Count); Assert.AreEqual (AceFlags.None, ((CommonAce)dacl [0]).AceFlags); Assert.AreEqual (AceFlags.None, ((CommonAce)dacl [1]).AceFlags); Assert.AreEqual (AceFlags.Inherited, ((CommonAce)dacl [2]).AceFlags); Assert.AreEqual (AceFlags.Inherited, ((CommonAce)dacl [3]).AceFlags); Assert.AreEqual (AceQualifier.AccessDenied, ((CommonAce)dacl [0]).AceQualifier); Assert.AreEqual (AceQualifier.AccessAllowed, ((CommonAce)dacl [1]).AceQualifier); Assert.AreEqual (AceQualifier.AccessAllowed, ((CommonAce)dacl [2]).AceQualifier); Assert.AreEqual (AceQualifier.AccessAllowed, ((CommonAce)dacl [3]).AceQualifier); GenericAce ace7 = dacl[0]; Assert.IsInstanceOfType (typeof (CommonAce), ace7); dacl.RemoveInheritedAces (); Assert.AreEqual (2, dacl.Count); dacl.Purge (sid); Assert.AreEqual (0, dacl.Count); }
public void PurgeAccessControl(SecurityIdentifier sid) { DiscretionaryAcl.Purge(sid); }