mscorlib(4.0.0.0) API with additions
FileSystemAuditRule.cs
2 
4 {
6  public sealed class FileSystemAuditRule : AuditRule
7  {
10  public FileSystemRights FileSystemRights => FileSystemAccessRule.RightsFromAccessMask(base.AccessMask);
11 
19  public FileSystemAuditRule(IdentityReference identity, FileSystemRights fileSystemRights, AuditFlags flags)
20  : this(identity, fileSystemRights, InheritanceFlags.None, PropagationFlags.None, flags)
21  {
22  }
23 
33  public FileSystemAuditRule(IdentityReference identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
34  : this(identity, AccessMaskFromRights(fileSystemRights), isInherited: false, inheritanceFlags, propagationFlags, flags)
35  {
36  }
37 
43  public FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, AuditFlags flags)
44  : this(new NTAccount(identity), fileSystemRights, InheritanceFlags.None, PropagationFlags.None, flags)
45  {
46  }
47 
54  public FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
55  : this(new NTAccount(identity), AccessMaskFromRights(fileSystemRights), isInherited: false, inheritanceFlags, propagationFlags, flags)
56  {
57  }
58 
59  internal FileSystemAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
60  : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, flags)
61  {
62  }
63 
64  private static int AccessMaskFromRights(FileSystemRights fileSystemRights)
65  {
66  if (fileSystemRights < (FileSystemRights)0 || fileSystemRights > FileSystemRights.FullControl)
67  {
68  throw new ArgumentOutOfRangeException("fileSystemRights", Environment.GetResourceString("Argument_InvalidEnumValue", fileSystemRights, "FileSystemRights"));
69  }
70  return (int)fileSystemRights;
71  }
72  }
73 }
FileSystemRights
Defines the access rights to use when creating access and audit rules.
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
FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.FileSystemAuditRule class using the...
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
FileSystemAuditRule(IdentityReference identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.FileSystemAuditRule class using the...
FileSystemAuditRule(IdentityReference identity, FileSystemRights fileSystemRights, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.FileSystemAuditRule class using a r...
FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, AuditFlags flags)
Initializes a new instance of the T:System.Security.AccessControl.FileSystemAuditRule class using a u...
Represents an abstraction of an access control entry (ACE) that defines an access rule for a file or ...
FileSystemRights FileSystemRights
Gets the T:System.Security.AccessControl.FileSystemRights flags associated with the current T:System....
InheritanceFlags
Inheritance flags specify the semantics of inheritance for access control entries (ACEs).
Represents an abstraction of an access control entry (ACE) that defines an audit rule for a file or d...
AuditFlags
Specifies the conditions for auditing attempts to access a securable object.
Definition: AuditFlags.cs:5