Export (0) Print
Expand All

SemaphoreAccessRule Constructor (IdentityReference, SemaphoreRights, AccessControlType)

Initializes a new instance of the SemaphoreAccessRule class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied.

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

public SemaphoreAccessRule(
	IdentityReference identity,
	SemaphoreRights eventRights,
	AccessControlType type
)

Parameters

identity
Type: System.Security.Principal.IdentityReference

The user or group the rule applies to. Must be of type SecurityIdentifier or a type such as NTAccount that can be converted to type SecurityIdentifier.

eventRights
Type: System.Security.AccessControl.SemaphoreRights

A bitwise combination of SemaphoreRights values specifying the rights allowed or denied.

type
Type: System.Security.AccessControl.AccessControlType

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

ExceptionCondition
ArgumentOutOfRangeException

eventRights specifies an invalid value.

-or-

type specifies an invalid value.

ArgumentNullException

identity is null.

-or-

eventRights is zero.

ArgumentException

identity is neither of type SecurityIdentifier nor of a type such as NTAccount that can be converted to type SecurityIdentifier.

To enter a Semaphore, for example by calling the WaitOne method, a user must have SemaphoreRights.Synchronize access. To exit the semaphore, by calling the Release method, the user must have SemaphoreRights.Modify access.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft