mscorlib(4.0.0.0) API with additions
AuditRule.cs
2 
4 {
7  public class AuditRule<T> : AuditRule where T : struct
8  {
11  public T Rights => (T)(object)base.AccessMask;
12 
17  public AuditRule(IdentityReference identity, T rights, AuditFlags flags)
18  : this(identity, rights, InheritanceFlags.None, PropagationFlags.None, flags)
19  {
20  }
21 
28  public AuditRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
29  : this(identity, (int)(object)rights, isInherited: false, inheritanceFlags, propagationFlags, flags)
30  {
31  }
32 
37  public AuditRule(string identity, T rights, AuditFlags flags)
38  : this((IdentityReference)new NTAccount(identity), rights, InheritanceFlags.None, PropagationFlags.None, flags)
39  {
40  }
41 
48  public AuditRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
49  : this((IdentityReference)new NTAccount(identity), (int)(object)rights, isInherited: false, inheritanceFlags, propagationFlags, flags)
50  {
51  }
52 
53  internal AuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
54  : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, flags)
55  {
56  }
57  }
59  public abstract class AuditRule : AuthorizationRule
60  {
61  private readonly AuditFlags _flags;
62 
65  public AuditFlags AuditFlags => _flags;
66 
77  protected AuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags auditFlags)
78  : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags)
79  {
80  if (auditFlags == AuditFlags.None)
81  {
82  throw new ArgumentException(Environment.GetResourceString("Arg_EnumAtLeastOneFlag"), "auditFlags");
83  }
84  if ((auditFlags & ~(AuditFlags.Success | AuditFlags.Failure)) != 0)
85  {
86  throw new ArgumentOutOfRangeException("auditFlags", Environment.GetResourceString("ArgumentOutOfRange_Enum"));
87  }
88  _flags = auditFlags;
89  }
90  }
91 }
PropagationFlags
Specifies how Access Control Entries (ACEs) are propagated to child objects. These flags are signific...
Represents an identity and is the base class for the T:System.Security.Principal.NTAccount and T:Syst...
Definition: __Canon.cs:3
The exception that is thrown when the value of an argument is outside the allowable range of values a...
Represents a user or group account.
Definition: NTAccount.cs:10
T Rights
Gets the rights of the audit rule.
Definition: AuditRule.cs:11
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
Represents a combination of a user’s identity and an access mask.
Definition: AuditRule.cs:7
AuditFlags AuditFlags
Gets the audit flags for this audit rule.
Definition: AuditRule.cs:65
AuditRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.AuditRule`1class by using the speci...
Definition: AuditRule.cs:48
The exception that is thrown when one of the arguments provided to a method is not valid.
AuditRule(string identity, T rights, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.AuditRule`1 class by using the spec...
Definition: AuditRule.cs:37
AuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags auditFlags)
Initializes a new instance of the T:System.Security.AccessControl.AuditRule class by using the specif...
Definition: AuditRule.cs:77
AuditRule(IdentityReference identity, T rights, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.AuditRule`1 class by using the spec...
Definition: AuditRule.cs:17
InheritanceFlags
Inheritance flags specify the semantics of inheritance for access control entries (ACEs).
AuditRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.AuditRule`1 class by using the spec...
Definition: AuditRule.cs:28
AuditFlags
Specifies the conditions for auditing attempts to access a securable object.
Definition: AuditFlags.cs:5