C# Class Thinktecture.IdentityModel.Claims.ClaimPermission

Inheritance: IPermission, ISecurityEncodable, IUnrestrictedPermission
Mostrar archivo Open project: IdentityModel/Thinktecture.IdentityModel.v1

Public Methods

Method Description
CheckAccess ( string action, string resource ) : bool

Calls ClaimsAuthorizationManager.

ClaimPermission ( string resource, string action ) : System

Initializes a new instance of the ClaimPermission class.

ClaimPermission ( string resourceType, string resource, string actionType, string action ) : System

Initializes a new instance of the ClaimPermission class.

Copy ( ) : IPermission

Creates and returns an identical copy of the current permission.

Demand ( ) : void

Throws a T:System.Security.SecurityException at run time if the security requirement is not met.

FromXml ( SecurityElement e ) : void

Reconstructs a security object with a specified state from an XML encoding.

Intersect ( IPermission target ) : IPermission

Creates and returns a permission that is the intersection of the current permission and the specified permission.

IsSubsetOf ( IPermission target ) : bool

Determines whether the current permission is a subset of the specified permission.

IsUnrestricted ( ) : bool

Returns a value indicating whether unrestricted access to the resource protected by the permission is allowed.

ToXml ( ) : SecurityElement

Creates an XML encoding of the security object and its current state.

Union ( IPermission target ) : IPermission

Creates a permission that is the union of the current permission and the specified permission.

Private Methods

Method Description
ClaimPermission ( IEnumerable resourceActions ) : System
CreateAuthorizationContext ( IClaimsPrincipal currentPrincipal, ResourceAction resourceAction ) : AuthorizationContext
ThrowSecurityException ( ) : void

Method Details

CheckAccess() public static method

Calls ClaimsAuthorizationManager.
public static CheckAccess ( string action, string resource ) : bool
action string The action.
resource string The resource.
return bool

ClaimPermission() public method

Initializes a new instance of the ClaimPermission class.
public ClaimPermission ( string resource, string action ) : System
resource string The resource.
action string The action.
return System

ClaimPermission() public method

Initializes a new instance of the ClaimPermission class.
public ClaimPermission ( string resourceType, string resource, string actionType, string action ) : System
resourceType string Type of the resource.
resource string The resource.
actionType string Type of the action.
action string The action.
return System

Copy() public method

Creates and returns an identical copy of the current permission.
public Copy ( ) : IPermission
return IPermission

Demand() public method

Throws a T:System.Security.SecurityException at run time if the security requirement is not met.
public Demand ( ) : void
return void

FromXml() public method

Reconstructs a security object with a specified state from an XML encoding.
public FromXml ( SecurityElement e ) : void
e System.Security.SecurityElement The XML encoding to use to reconstruct the security object.
return void

Intersect() public method

Creates and returns a permission that is the intersection of the current permission and the specified permission.
The parameter is not null and is not an instance of the same class as the current permission.
public Intersect ( IPermission target ) : IPermission
target IPermission A permission to intersect with the current permission. It must be of the same type as the current permission.
return IPermission

IsSubsetOf() public method

Determines whether the current permission is a subset of the specified permission.
The parameter is not null and is not of the same type as the current permission.
public IsSubsetOf ( IPermission target ) : bool
target IPermission A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.
return bool

IsUnrestricted() public method

Returns a value indicating whether unrestricted access to the resource protected by the permission is allowed.
public IsUnrestricted ( ) : bool
return bool

ToXml() public method

Creates an XML encoding of the security object and its current state.
public ToXml ( ) : SecurityElement
return System.Security.SecurityElement

Union() public method

Creates a permission that is the union of the current permission and the specified permission.
The parameter is not null and is not of the same type as the current permission.
public Union ( IPermission target ) : IPermission
target IPermission A permission to combine with the current permission. It must be of the same type as the current permission.
return IPermission