FileSystemAccessRule Constructor (String, FileSystemRights, InheritanceFlags, PropagationFlags, AccessControlType)

 

Initializes a new instance of the FileSystemAccessRule class using the name of a user account, a value that specifies the type of operation associated with the access rule, a value that determines how rights are inherited, a value that determines how rights are propagated, and a value that specifies whether to allow or deny the operation.

Namespace:   System.Security.AccessControl
Assembly:  mscorlib (in mscorlib.dll)

public FileSystemAccessRule(
	string identity,
	FileSystemRights fileSystemRights,
	InheritanceFlags inheritanceFlags,
	PropagationFlags propagationFlags,
	AccessControlType type
)

Parameters

identity
Type: System.String

The name of a user account.

fileSystemRights
Type: System.Security.AccessControl.FileSystemRights

One of the FileSystemRights values that specifies the type of operation associated with the access rule.

inheritanceFlags
Type: System.Security.AccessControl.InheritanceFlags

One of the InheritanceFlags values that specifies how access masks are propagated to child objects.

propagationFlags
Type: System.Security.AccessControl.PropagationFlags

One of the PropagationFlags values that specifies how Access Control Entries (ACEs) are propagated to child objects.

type
Type: System.Security.AccessControl.AccessControlType

One of the AccessControlType values that specifies whether to allow or deny the operation.

Exception Condition
ArgumentNullException

The identity parameter is null.

ArgumentOutOfRangeException

An incorrect enumeration was passed to the type parameter.

-or-

An incorrect enumeration was passed to the inheritanceFlags parameter.

-or-

An incorrect enumeration was passed to the propagationFlags parameter.

Use this constructor to create an access control rule that you can persist using the FileSecurity or DirectorySecurity class. Access control rules define user account rights that determine which actions are allowed or disallowed on computers running Microsoft Windows.

The identity parameter must identify a valid account on the current computer or domain. The string takes the following form, where DOMAIN is the name of a valid domain or computer name and account is the name of a valid user account on a domain or computer: DOMAIN\account.

.NET Framework
Available since 2.0
Return to top
Show: