<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0-preview.5.20278.1" />

System.Security.AccessControl.DirectoryObjectSecurity

public abstract class DirectoryObjectSecurity : ObjectSecurity
Provides the ability to control access to directory objects without direct manipulation of Access Control Lists (ACLs).

Initializes a new instance of the DirectoryObjectSecurity class.

protected DirectoryObjectSecurity(CommonSecurityDescriptor securityDescriptor)

Initializes a new instance of the DirectoryObjectSecurity class with the specified security descriptor.

public virtual AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type, Guid objectType, Guid inheritedObjectType)

Initializes a new instance of the AccessRule class with the specified values.

protected void AddAccessRule(ObjectAccessRule rule)

Adds the specified access rule to the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object.

protected void AddAuditRule(ObjectAuditRule rule)

Adds the specified audit rule to the System Access Control List (SACL) associated with this DirectoryObjectSecurity object.

public virtual AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags, Guid objectType, Guid inheritedObjectType)

Initializes a new instance of the AuditRule class with the specified values.

public AuthorizationRuleCollection GetAccessRules(bool includeExplicit, bool includeInherited, Type targetType)

Gets a collection of the access rules associated with the specified security identifier.

public AuthorizationRuleCollection GetAuditRules(bool includeExplicit, bool includeInherited, Type targetType)

Gets a collection of the audit rules associated with the specified security identifier.

protected bool RemoveAccessRule(ObjectAccessRule rule)

Removes access rules that contain the same security identifier and access mask as the specified access rule from the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object.

Removes all access rules that have the same security identifier as the specified access rule from the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object.

Removes all access rules that exactly match the specified access rule from the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object.

protected bool RemoveAuditRule(ObjectAuditRule rule)

Removes audit rules that contain the same security identifier and access mask as the specified audit rule from the System Access Control List (SACL) associated with this CommonObjectSecurity object.

protected void RemoveAuditRuleAll(ObjectAuditRule rule)

Removes all audit rules that have the same security identifier as the specified audit rule from the System Access Control List (SACL) associated with this DirectoryObjectSecurity object.

Removes all audit rules that exactly match the specified audit rule from the System Access Control List (SACL) associated with this DirectoryObjectSecurity object.

protected void ResetAccessRule(ObjectAccessRule rule)

Removes all access rules in the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object and then adds the specified access rule.

protected void SetAccessRule(ObjectAccessRule rule)

Removes all access rules that contain the same security identifier and qualifier as the specified access rule in the Discretionary Access Control List (DACL) associated with this DirectoryObjectSecurity object and then adds the specified access rule.

protected void SetAuditRule(ObjectAuditRule rule)

Removes all audit rules that contain the same security identifier and qualifier as the specified audit rule in the System Access Control List (SACL) associated with this DirectoryObjectSecurity object and then adds the specified audit rule.