コード例 #1
0
        public void PurgeAccessControl(SecurityIdentifier sid)
        {
            ArgumentNullException.ThrowIfNull(sid);

            if (DiscretionaryAcl != null)
            {
                DiscretionaryAcl.Purge(sid);
            }
        }
コード例 #2
0
        public void PurgeAccessControl(SecurityIdentifier sid)
        {
            if (sid == null)
            {
                throw new ArgumentNullException(nameof(sid));
            }

            if (DiscretionaryAcl != null)
            {
                DiscretionaryAcl.Purge(sid);
            }
        }
コード例 #3
0
        public void PurgeAccessControl(SecurityIdentifier sid)
        {
            if (sid == null)
            {
                throw new ArgumentNullException("sid");
            }
            Contract.EndContractBlock();

            if (DiscretionaryAcl != null)
            {
                DiscretionaryAcl.Purge(sid);
            }
        }
コード例 #4
0
ファイル: CommonAclTest.cs プロジェクト: nlhepler/mono
		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);
		}
コード例 #5
0
 public void PurgeAccessControl(SecurityIdentifier sid)
 {
     DiscretionaryAcl.Purge(sid);
 }