System.Security.AccessControl.FileSystemSecurity.AccessRuleFactory Method

Initializes a new instance of the System.Security.AccessControl.FileSystemAccessRule class that represents a new access control rule for the specified user, with the specified access rights, access control, and flags.

Syntax

public override sealed AccessRule AccessRuleFactory (System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)

Parameters

identityReference
An System.Security.Principal.IdentityReference object that represents a user account.
accessMask
An integer that specifies an access type.
isInherited
true if the access rule is inherited; otherwise, false.
inheritanceFlags
One of the System.Security.AccessControl.InheritanceFlags values that specifies how to propagate access masks to child objects.
propagationFlags
One of the System.Security.AccessControl.PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.
type
One of the System.Security.AccessControl.AccessControlType values that specifies whether access is allowed or denied.

Returns

A new System.Security.AccessControl.FileSystemAccessRule object that represents a new access control rule for the specified user, with the specified access rights, access control, and flags.

Remarks

The recommended way to create access control rules is to use the constructors of the System.Security.AccessControl.FileSystemAccessRule class.

The return type of the FileSystemSecurity.AccessRuleFactory(System.Security.Principal.IdentityReference, int, bool, InheritanceFlags, PropagationFlags, AccessControlType) method is the base class, System.Security.AccessControl.AccessRule, but the return value can be cast safely to the derived class.

Requirements

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