Exemple #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);
        }
Exemple #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);
        }
Exemple #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");
        }
Exemple #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);
        }
Exemple #6
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     base.SetAuditRule(rule);
 }
		public void AddAuditRule (FileSystemAuditRule rule)
		{
			AddAuditRule ((AuditRule)rule);
		}
Exemple #8
0
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleSpecific(rule);
 }
Exemple #9
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return base.RemoveAuditRule(rule);
 }
Exemple #10
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     base.AddAuditRule(rule);
 }
Exemple #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();
 }
Exemple #12
0
		public void SetAuditRule (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
Exemple #13
0
		public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
Exemple #14
0
		public bool RemoveAuditRule (FileSystemAuditRule rule)
		{
			throw new NotImplementedException ();
		}
		public void SetAuditRule (FileSystemAuditRule rule)
		{
			SetAuditRule((AuditRule)rule);
		}
		public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
		{
			RemoveAuditRuleSpecific((AuditRule)rule);
		}
		public bool RemoveAuditRule (FileSystemAuditRule rule)
		{
			return RemoveAuditRule((AuditRule)rule);
		}
Exemple #18
0
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleAll(rule);
 }
Exemple #19
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
 }
 public void SetAuditRule(FileSystemAuditRule rule)
 {
 }
Exemple #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)
 {
 }
Exemple #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);
 }
Exemple #25
0
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     base.SetAuditRule(rule);
 }
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
 }
Exemple #27
0
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleAll(rule);
 }
Exemple #28
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
 }
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     AddAuditRule((AuditRule)rule);
 }
Exemple #30
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(default(bool));
 }
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(RemoveAuditRule((AuditRule)rule));
 }
 public void RemoveAuditRuleAll(FileSystemAuditRule rule)
 {
     RemoveAuditRuleAll((AuditRule)rule);
 }
Exemple #33
0
 public void AddAuditRule(FileSystemAuditRule rule)
 {
     base.AddAuditRule(rule);
 }
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     RemoveAuditRuleSpecific((AuditRule)rule);
 }
Exemple #35
0
 public bool RemoveAuditRule(FileSystemAuditRule rule)
 {
     return(base.RemoveAuditRule(rule));
 }
 public void SetAuditRule(FileSystemAuditRule rule)
 {
     SetAuditRule((AuditRule)rule);
 }
Exemple #37
0
 public void RemoveAuditRuleSpecific(FileSystemAuditRule rule)
 {
     base.RemoveAuditRuleSpecific(rule);
 }
Exemple #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)
 {
 }