ActivityPermittedHandler

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

Summary

Implements the IActivityPermittedHandler for service stack.

Constructors

#ctor(userService,authRequestDefinitionRegistrar,entityIdAuthorizer,errorResourceProvider,settings,logger)

Summary

Initializes a new instance of the ActivityPermittedHandler class.

Parameters
Name Type Description
userService ASPSecurityKit.IUserService The userService.
authRequestDefinitionRegistrar ASPSecurityKit.ServiceStack.IServiceStackSecuritySettings The authRequestDefinitionRegistrar.
entityIdAuthorizer ASPSecurityKit.Authorization.IEntityIdAuthorizer The authorizer to authorize entityIds mentioned within the requested action parameters.
errorResourceProvider ASPSecurityKit.IErrorMessageResourceProvider The error message provider.
settings ASPSecurityKit.ServiceStack.IAuthorizeRequestDefinitionRegistrar The security settings.
logger ASPSecurityKit.ILogger The logger.

Properties

UserService

Summary

Gets the user service.

Value

The user service.

Settings

Summary

Gets the security settings.

Value

The security settings.

ErrorResourceProvider

Summary

Gets the error message provider.

Value

The error message provider.

Methods

IsPermitted(requestService)

Summary

Determines whether the current identity has the necessary permit to perform the specified request.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsPermitted(requestService,authDef,verb,dto,permissionCode,checkPermissionExistenceOnly)

Summary

Determines whether user is permitted to perform the specified action.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
authDef ASPSecurityKit.ServiceStack.IAuthorizeRequestDefinition The authDefinition (if any) for the request.
verb System.String The request verb.
dto System.Object The request dto.
permissionCode System.String The permissionCode.
checkPermissionExistenceOnly System.Boolean Indicates whether to authorize based on mere possession of the permissionCode (regardless of the entityId value).

IsPermittedAsync(requestService)

Summary

Determines whether the current identity has the necessary permit to perform the specified request.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsPermittedAsync(requestService,cancellationToken)

Summary

Determines whether the current identity has the necessary permit to perform the specified request.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsPermittedAsync(requestService,authDef,verb,dto,permissionCode,checkPermissionExistenceOnly)

Summary

Determines whether user is permitted to perform the specified action.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
authDef ASPSecurityKit.ServiceStack.IAuthorizeRequestDefinition The authDefinition (if any) for the request.
verb System.String The request verb.
dto System.Object The request dto.
permissionCode System.String The permissionCode.
checkPermissionExistenceOnly System.Boolean Indicates whether to authorize based on mere possession of the permissionCode (regardless of the entityId value).

IsPermittedAsync(requestService,authDef,verb,dto,permissionCode,checkPermissionExistenceOnly,cancellationToken)

Summary

Determines whether user is permitted to perform the specified action.

Returns

AuthResult instance with Code as Success if the current identity has the necessary permit; otherwise, a possible reason of failure.

Parameters
Name Type Description
requestService ASPSecurityKit.ServiceStack.IServiceStackRequestService The request service.
authDef ASPSecurityKit.ServiceStack.IAuthorizeRequestDefinition The authDefinition (if any) for the request.
verb System.String The request verb.
dto System.Object The request dto.
permissionCode System.String The permissionCode.
checkPermissionExistenceOnly System.Boolean Indicates whether to authorize based on mere possession of the permissionCode (regardless of the entityId value).
cancellationToken System.Threading.CancellationToken The cancellation token.