IAuthorizeRequestDefinition

Namespace: ASPSecurityKit.ServiceStack
Assembly: ASPSecurityKit.ServiceStack.dll

Summary

Represents auth definition to provide authorization related methods for a request. Typically Created out of types that implements multiple auth definitions and mark themselves with IAuthorizeRequestDefinitionsContainer.

Properties

CanAuthorize

Summary

Gets a value indicating whether this instance can authorize the associated request (it could be implementing only a getId method).

Value

true if this instance can authorize the associated request; otherwise, false.

Methods

IsAuthorized(dto,permissionCode)

Summary

Determines whether or not given request is authorized.

Returns

AuthResult instance with Code as Success if the given request is authorized; otherwise, a possible reason of failure.

Parameters
Name Type Description
dto System.Object The request dto.
permissionCode System.String The permissionCode.
Exceptions
Type Description
System.InvalidOperationException When no authorizer is registered.

IsAuthorizedAsync(dto,permissionCode)

Summary

Determines whether or not given request is authorized.

Returns

AuthResult instance with Code as Success if the given request is authorized; otherwise, a possible reason of failure.

Parameters
Name Type Description
dto System.Object The request dto.
permissionCode System.String The permissionCode.
Exceptions
Type Description
System.InvalidOperationException When no authorizer is registered.

IsAuthorizedAsync(dto,permissionCode,cancellationToken)

Summary

Determines whether or not given request is authorized.

Returns

AuthResult instance with Code as Success if the given request is authorized; otherwise, a possible reason of failure.

Parameters
Name Type Description
dto System.Object The request dto.
permissionCode System.String The permissionCode.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.InvalidOperationException When no authorizer is registered.