Edit

Share via


ClaimsPrincipalPermission(String, String) Constructor

Definition

Creates a new instance of the ClaimsPrincipalPermission class.

public:
 ClaimsPrincipalPermission(System::String ^ resource, System::String ^ action);
public ClaimsPrincipalPermission (string resource, string action);
new System.IdentityModel.Services.ClaimsPrincipalPermission : string * string -> System.IdentityModel.Services.ClaimsPrincipalPermission
Public Sub New (resource As String, action As String)

Parameters

resource
String

The resource on which the principal should be authorized.

action
String

The action for which the principal should be authorized.

Exceptions

resource is null or an empty string.

action is null.

Remarks

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.

Applies to