ActivityPermittedHandler

Namespace: ASPSecurityKit.Net
Assembly: ASPSecurityKit.Net.dll

Summary

Implements the IActivityPermittedHandler for service stack

Constructors

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

Summary

Initializes a new instance of the ActivityPermittedHandler class.

Parameters
Name Type Description
userService ASPSecurityKit.IUserService The user service.
settings ASPSecurityKit.Net.INetSecuritySettings The security settings.
entityIdAuthorizer ASPSecurityKit.Authorization.IEntityIdAuthorizer The authorizer to authorize entityIds mentioned within the requested action parameters.
errorResourceProvider ASPSecurityKit.IErrorMessageResourceProvider The error message provider.
authorizeRequestDefinitionRegistrar ASPSecurityKit.Net.IAuthorizeRequestDefinitionRegistrar The registrar to resolve the authDefinition (if any) for the request.
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.Net.INetRequestService The request service.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsPermitted(requestService,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.Net.INetRequestService The request service.
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.Net.INetRequestService 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.Net.INetRequestService The request service.
cancellationToken System.Threading.CancellationToken The cancellation token.
Exceptions
Type Description
System.ArgumentNullException When requestService is null.

IsPermittedAsync(requestService,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.Net.INetRequestService The request service.
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,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.Net.INetRequestService The request service.
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.