ClaimsPrincipalPermissionAttribute Class
Windows Identity Foundation
Represents the attribute used to declaratively request access checks using the claims authorization manager.
Namespace: Microsoft.IdentityModel.Claims
Assembly: Microsoft.IdentityModel (in microsoft.identitymodel.dll)
Dim instance As ClaimsPrincipalPermissionAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple=true)] public class ClaimsPrincipalPermissionAttribute : CodeAccessSecurityAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple=true) */ public class ClaimsPrincipalPermissionAttribute extends CodeAccessSecurityAttribute
The following code example shows how to attribute a method. The claims authorization manager will be invoked to authorize any IClaimsPrincipal that tries to execute the method.
class Program
{
//
// Declarative access check using the permission class
//
[ClaimsPrincipalPermission( System.Security.SecurityAction.Demand, Resource = "resource", Operation = "action")]
[ClaimsPrincipalPermission( SecurityAction.Demand, Resource = "resource1", Operation = "action1" )]
static void ProtectedMethod()
{
}
The ClaimsPrincipalPermissionAttribute is used to declaratively request an access check using the configured claims authorization manager through the ClaimsPrincipalPermission class. See the Claims Based Authorization SDK sample in the <Installation Directory>\Windows Identity Foundation SDK\<Version>\Samples\Extensibility directory for a full example of how to invoke the claims authorization manager to authorize access for protected sections of code.
System.Object
System.Attribute
System.Security.Permissions.SecurityAttribute
System.Security.Permissions.CodeAccessSecurityAttribute
Microsoft.IdentityModel.Claims.ClaimsPrincipalPermissionAttribute
System.Attribute
System.Security.Permissions.SecurityAttribute
System.Security.Permissions.CodeAccessSecurityAttribute
Microsoft.IdentityModel.Claims.ClaimsPrincipalPermissionAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.