Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the specified type of access control list (ACL) entries for a specified directory.
- path
The path to a directory containing a System.Security.AccessControl.DirectorySecurity object that describes the file's access control list (ACL) information.
- includeSections
One of the System.Security.AccessControl.AccessControlSections values that specifies the type of access control list (ACL) information to receive.
![]()
An object that encapsulates the access control rules for the file described by the path parameter.
Use the Directory.GetAccessControl(string, System.Security.AccessControl.AccessControlSections) method to retrieve the access control list (ACL) entries for a directory.
An ACL describes individuals and/or groups who have, or do not have, rights to specific actions on the given file or directory. For more information, see ACL Technology Overview and How to: Add or Remove an Access Control List Entry.
In NTFS environments, System.Security.AccessControl.FileSystemRights.ReadAttributes and System.Security.AccessControl.FileSystemRights.ReadExtendedAttributes are granted to the user if the user has System.Security.AccessControl.FileSystemRights.ListDirectory rights on the parent folder. To deny System.Security.AccessControl.FileSystemRights.ReadAttributes and System.Security.AccessControl.FileSystemRights.ReadExtendedAttributes, deny System.Security.AccessControl.FileSystemRights.ListDirectory on the parent directory.