System.Security.AccessControl.FileSystemSecurity Class

Represents the access control and audit security for a file or directory.

See Also: FileSystemSecurity Members

Syntax

public abstract class FileSystemSecurity : NativeObjectSecurity

Remarks

The System.Security.AccessControl.FileSystemSecurity class is the base class for the System.Security.AccessControl.FileSecurity and System.Security.AccessControl.DirectorySecurity classes. These classes represent all of the access rights for a system file or directory and define how access attempts are audited.

The System.Security.AccessControl.FileSystemSecurity class represents access and audit rights as a set of rules. Each access rule is represented by a System.Security.AccessControl.FileSystemAccessRule object, while each audit rule is represented by a System.Security.AccessControl.FileSystemAuditRule object.

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

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

To persist new or changed access control list (ACL) information to a file, use the System.IO.File.SetAccessControl(string, FileSecurity) or System.IO.FileInfo.SetAccessControl(FileSecurity) method. To persist new or changed ACL information to a directory, use the System.IO.Directory.SetAccessControl(string, DirectorySecurity) or System.IO.FileInfo.SetAccessControl(FileSecurity) method.

To retrieve ACL information from a file, use the erload:System.IO.File.GetAccessControl or erload:System.IO.FileInfo.GetAccessControl method. To retrieve ACL information from a directory, use the erload:System.IO.Directory.GetAccessControl or erload:System.IO.DirectoryInfo.GetAccessControl method.

Requirements

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