FileSystemSecurity.AccessRuleFactory Method
Assembly: mscorlib (in mscorlib.dll)
public override sealed AccessRule AccessRuleFactory ( IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type )
public final AccessRule AccessRuleFactory ( IdentityReference identityReference, int accessMask, boolean isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type )
public override final function AccessRuleFactory ( identityReference : IdentityReference, accessMask : int, isInherited : boolean, inheritanceFlags : InheritanceFlags, propagationFlags : PropagationFlags, type : AccessControlType ) : AccessRule
Parameters
- identityReference
An 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 InheritanceFlags values that specifies how to propagate access masks to child objects.
- propagationFlags
One of the PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.
- type
One of the AccessControlType values that specifies whether access is allowed or denied.
Return Value
A new FileSystemAccessRule object that represents a new access control rule for the specified user, with the specified access rights, access control, and flags.| Exception type | Condition |
|---|---|
| The accessMask, inheritanceFlags, propagationFlags, or type parameters specify an invalid value. | |
| The identityReference parameter is a null reference (Nothing in Visual Basic). -or- The accessMask parameter is zero. | |
| The identityReference parameter is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier. |
The recommended way to create access control rules is to use the constructors of the FileSystemAccessRule class.
The return type of the AccessRuleFactory method is the base class, AccessRule, but the return value can be cast safely to the derived class.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.