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

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the FileSystemAccessRule class using a reference to 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(
	IdentityReference identity,
	FileSystemRights fileSystemRights,
	InheritanceFlags inheritanceFlags,
	PropagationFlags propagationFlags,
	AccessControlType type
)

Parameters

identity
Type: System.Security.Principal.IdentityReference

An IdentityReference object that encapsulates a reference to 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
ArgumentException

The identity parameter is not an IdentityReference object.

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.

.NET Framework
Available since 2.0
Return to top
Show: