ClaimsPrincipalPermission Constructor (String, String)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Creates a new instance of the ClaimsPrincipalPermission class.

Namespace:   System.IdentityModel.Services
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

public ClaimsPrincipalPermission(
	string resource,
	string action


Type: System.String

The resource on which the principal should be authorized.

Type: System.String

The action for which the principal should be authorized.

Exception Condition

resource is null or an empty string.


action is null.

The ClaimsPrincipalPermission object is initialized with the specified resource-action pair. You can call the Demand method to perform an access check.

Although the constructor only takes a single resource and action, ClaimsPrincipalPermission objects can be combined through the Union and Intersect methods. The permission created through these methods may contain multiple resource-action pairs.

.NET Framework
Available since 4.5
Return to top