mscorlib 2.0.0.0 4.0.0.0 System.Security.AccessControl.FileSystemSecurity

The class specifies the access rights for a system directory and how access attempts are audited. This class represents access and audit rights as a set of rules. Each access rule is represented by a object, while each audit rule is represented by a object.

The class is an abstraction of the underlying Windows file security system. In this system, each directory has a discretionary access control list (DACL), which controls access to the directory, and a system access control list (SACL), which specifies the access control attempts that are audited. The and classes are abstractions of the access control entries (ACEs) that comprise DACLs and SACLs.

The class hides many of the details of DACLs and SACLs; you do not have to worry about ACE ordering or null DACLS.

Use the class to retrieve, add, or change the access rules that represent the DACL and SACL of a file.

The following tables lists the methods you can use to access and maintain directory security.

Task

Methods

Add rules

Remove rules

Retrieve the access control to a directory

Persist the access control to a directory

Represents the access control and audit security for a directory. This class cannot be inherited.

- Constructor
  2.0.0.0
  4.0.0.0

  Use this constructor when you want to create an empty object that is not based on an existing directory. You can then populate the object with access control information and apply it to a directory.

  Initializes a new instance of the class.

- Constructor
  2.0.0.0
  4.0.0.0

  This constructor retrieves the access control information for the specified directory and then creates a object that encapsulates that information. You can then inspect, add, or delete the access control information for the specified directory.

  Initializes a new instance of the class from a specified directory using the specified values of the enumeration.

  The location of a directory to create a object from.
  One of the values that specifies the type of access control list (ACL) information to retrieve.