NAME

Articulate::Permission - represent a permission request/response

FUNCTIONS

permission

my $permission = permission $user, verb => $location;

Creates a new request, using the verb and data supplied as the respective arguments.

METHODS

new

An unremarkable Moo constructor.

grant

$permission->grant('Anybody can do that!');

Declares that the user has that permission, for the reason given; sets granted and denied and populates the stack trace.

deny

$permission->deny('Don\t touch that!');

Declares that the user does not have that permission, for the reason given; sets granted and denied and populates the stack trace.

ATTRIBUTES

user_id

The user_id requesting permission to access the resource.

verb

The action being performed, e.g. read, write, etc. The verbs available are entirely dependant on the application.

A permission request will be granted or denied by an authorisation rule (see Articulate::Authorisation), who will typically implement verbs that bay be different from but are either a) broader than, or b) equally broad as, the verbs used by the Articulate::Service.

location

The location of the resource for which permission is requested.

granted

Whether or not the permission has been explicitly granted. The value of this is used for overload behaviour.

Please do not explicitly set this. Use grant instead.

denied

Whether the permission has been explicitly denied.

Please do not explicitly set this. Use deny instead.

reason

The reason for the grant or denial of permission.

Please do not explicitly set this. Use grant or deny instead.

stack_trace

The stack trace at the point of grant or denial of permission.

Please do not explicitly set this. Use grant or deny instead.

SEE ALSO