示例#1
0
        public void FileSystemRights_ReturnValidObject()
        {
            var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AuditFlags.Failure);
            FileSystemRights fileSystemRights = auditRule.FileSystemRights;

            Assert.Equal(fileSystemRights, FileSystemRights.ReadData);
        }
示例#2
0
        public void ObjectInitialization_IdentityReference_FileSystemRights_AuditFlags_Success()
        {
            var auditRule = new FileSystemAuditRule(Helpers.s_WorldSidNTAccount, FileSystemRights.ReadData, AuditFlags.Failure);

            Assert.Equal(auditRule.IdentityReference, Helpers.s_WorldSidNTAccount);
            Assert.Equal(auditRule.FileSystemRights, FileSystemRights.ReadData);
            Assert.Equal(auditRule.AuditFlags, AuditFlags.Failure);
        }
示例#3
0
        public void ObjectInitialization_Identity_FileSystemRights_AuditFlags_Success()
        {
            var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AuditFlags.Failure);

            Assert.Equal(auditRule.FileSystemRights, FileSystemRights.ReadData);
            Assert.Equal(auditRule.AuditFlags, AuditFlags.Failure);
            Assert.Equal(auditRule.IdentityReference.Value, @"MYDOMAIN\MyAccount");
        }
示例#4
0
        public void ObjectInitialization_Identity_FileSystemRights_AuditFlags_InheritanceFlag_PropagationFlag_Success()
        {
            var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData,
                                                    InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AuditFlags.Failure);

            Assert.Equal(auditRule.PropagationFlags, PropagationFlags.InheritOnly);
            Assert.Equal(auditRule.InheritanceFlags, InheritanceFlags.ObjectInherit);
        }
        public void ObjectInitialization_IdentityReference_FileSystemRights_AuditFlags_Success()
        {
            var identity  = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
            var auditRule = new FileSystemAuditRule(identity, FileSystemRights.ReadData, AuditFlags.Failure);

            Assert.Equal(auditRule.IdentityReference, identity);
            Assert.Equal(auditRule.FileSystemRights, FileSystemRights.ReadData);
            Assert.Equal(auditRule.AuditFlags, AuditFlags.Failure);
        }
示例#6
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     base.SetAuditRule(rule);
 }
		public void AddAuditRule (FileSystemAuditRule rule)
		{
			AddAuditRule ((AuditRule)rule);
		}
示例#8
0
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleSpecific(rule);
 }
示例#9
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return base.RemoveAuditRule(rule);
 }
示例#10
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     base.AddAuditRule(rule);
 }
示例#11
0
 /// <summary>Removes all matching allow or deny audit rules from the current file or directory.</summary><returns>true if the audit rule was removed; otherwise, false</returns><param name="rule">A <see cref="T:System.Security.AccessControl.FileSystemAuditRule" />  object that represents an audit rule to remove from a file or directory.</param><exception cref="T:System.ArgumentNullException">The <paramref name="rule" /> parameter is null.</exception>
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     throw new NotImplementedException();
 }
示例#12
0
		public void SetAuditRule (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
示例#13
0
		public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
示例#14
0
		public bool RemoveAuditRule (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
示例#15
0
		public void SetAuditRule (FileSystemAuditRule rule)
		{
			SetAuditRule((AuditRule)rule);
		}
示例#16
0
		public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
		{
			RemoveAuditRuleSpecific((AuditRule)rule);
		}
示例#17
0
		public bool RemoveAuditRule (FileSystemAuditRule rule)
		{
			return RemoveAuditRule((AuditRule)rule);
		}
示例#18
0
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleAll(rule);
 }
示例#19
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
 }
 public void SetAuditRule(FileSystemAuditRule rule)
 {
 }
示例#21
0
 /// <summary>Sets the specified audit rule for the current file or directory.</summary><param name="rule">A <see cref="T:System.Security.AccessControl.FileSystemAuditRule" /> object that represents an audit rule to set for a file or directory.</param><exception cref="T:System.ArgumentNullException">The <paramref name="rule" /> parameter is null.</exception>
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     throw new NotImplementedException();
 }
 public void AddAuditRule(FileSystemAuditRule rule)
 {
 }
示例#23
0
 /// <summary>Removes all audit rules for the specified user from the current file or directory.</summary><param name="rule">A <see cref="T:System.Security.AccessControl.FileSystemAuditRule" /> object that specifies a user whose audit rules should be removed from a file or directory.</param><exception cref="T:System.ArgumentNullException">The <paramref name="rule" /> parameter is null.</exception>
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     throw new NotImplementedException();
 }
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
   return default(bool);
 }
示例#25
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     base.SetAuditRule(rule);
 }
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
 }
示例#27
0
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleAll(rule);
 }
示例#28
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
 }
示例#29
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     AddAuditRule((AuditRule)rule);
 }
示例#30
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(default(bool));
 }
示例#31
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(RemoveAuditRule((AuditRule)rule));
 }
示例#32
0
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     RemoveAuditRuleAll((AuditRule)rule);
 }
示例#33
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     base.AddAuditRule(rule);
 }
示例#34
0
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     RemoveAuditRuleSpecific((AuditRule)rule);
 }
示例#35
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(base.RemoveAuditRule(rule));
 }
示例#36
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     SetAuditRule((AuditRule)rule);
 }
示例#37
0
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleSpecific(rule);
 }
示例#38
0
 /// <summary>使用以下内容初始化 <see cref="T:System.Security.AccessControl.FileSystemAuditRule" /> 类的新实例:用户帐户的名称、指定与审核规则关联的操作的类型的值、确定如何继承权限的值、确定如何传播权限的值,以及指定何时执行审核的值。</summary>
 /// <param name="identity">用户帐户的名称。</param>
 /// <param name="fileSystemRights">
 /// <see cref="T:System.Security.AccessControl.FileSystemRights" /> 值之一,该值指定与审核规则关联的操作的类型。</param>
 /// <param name="inheritanceFlags">
 /// <see cref="T:System.Security.AccessControl.InheritanceFlags" /> 值之一,该值指定访问掩码如何传播到子对象。</param>
 /// <param name="propagationFlags">
 /// <see cref="T:System.Security.AccessControl.PropagationFlags" /> 值之一,该值指定访问控制项 (ACE) 如何传播到子对象。</param>
 /// <param name="flags">
 /// <see cref="T:System.Security.AccessControl.AuditFlags" /> 值之一,该值指定何时执行审核。</param>
 public FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
     : this((IdentityReference) new NTAccount(identity), FileSystemAuditRule.AccessMaskFromRights(fileSystemRights), false, inheritanceFlags, propagationFlags, flags)
 {
 }