ClaimsPrincipalPermission Constructor (String^, String^)
.NET Framework (current version)
Creates a new instance of the ClaimsPrincipalPermission class.
Assembly: System.IdentityModel.Services (in System.IdentityModel.Services.dll)
Parameters
- resource
-
Type:
System::String^
The resource on which the principal should be authorized.
- action
-
Type:
System::String^
The action for which the principal should be authorized.
| Exception | Condition |
|---|---|
| ArgumentException | resource is null or an empty string. |
| ArgumentNullException | 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
Available since 4.5
Show: