SemaphoreAccessRule Constructor (IdentityReference, SemaphoreRights, 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 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.

Exception Condition
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
Available since 2.0
Return to top
Show: