System.IO.Directory.GetAccessControl Method

Gets a System.Security.AccessControl.DirectorySecurity object that encapsulates the access control list (ACL) entries for a specified directory.

Syntax

public static System.Security.AccessControl.DirectorySecurity GetAccessControl (string path)

Parameters

path
The path to a directory containing a System.Security.AccessControl.DirectorySecurity object that describes the file's access control list (ACL) information.

Returns

An object that encapsulates the access control rules for the file described by the path parameter.

Remarks

Use the Directory.GetAccessControl(string) 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.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0