MutexSecurity.AccessRuleFactory Method

Note: This method is new in the .NET Framework version 2.0.

Creates a new access control rule for the specified user, with the specified access rights, access control, and flags.

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

public override AccessRule AccessRuleFactory (
	IdentityReference identityReference,
	int accessMask,
	bool isInherited,
	InheritanceFlags inheritanceFlags,
	PropagationFlags propagationFlags,
	AccessControlType type
)
public AccessRule AccessRuleFactory (
	IdentityReference identityReference, 
	int accessMask, 
	boolean isInherited, 
	InheritanceFlags inheritanceFlags, 
	PropagationFlags propagationFlags, 
	AccessControlType type
)
public override function AccessRuleFactory (
	identityReference : IdentityReference, 
	accessMask : int, 
	isInherited : boolean, 
	inheritanceFlags : InheritanceFlags, 
	propagationFlags : PropagationFlags, 
	type : AccessControlType
) : AccessRule

Parameters

identityReference

An IdentityReference that identifies the user or group the rule applies to.

accessMask

A bitwise combination of MutexRights values specifying the access rights to allow or deny, cast to an integer.

isInherited

Meaningless for named mutexes, because they have no hierarchy.

inheritanceFlags

Meaningless for named mutexes, because they have no hierarchy.

propagationFlags

Meaningless for named mutexes, because they have no hierarchy.

type

One of the AccessControlType values specifying whether the rights are allowed or denied.

Return Value

A MutexAccessRule object representing the specified rights for the specified user.

Exception typeCondition

ArgumentOutOfRangeException

accessMask, inheritanceFlags, propagationFlags, or type specifies an invalid value.

ArgumentNullException

identityReference is a null reference (Nothing in Visual Basic).

-or-

accessMask is zero.

ArgumentException

identityReference 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 MutexAccessRule class.

NoteNote

Although inheritance and propagation flags are meaningless for named mutexes, it is still possible to specify them. This is not recommended, because it needlessly complicates the maintenance of rules, for example by interfering with the combination of rules that would otherwise be compatible.

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.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: