Acl
Restrict calling a class method using an acl. Arguments are declared in pairs of a check type and an option object. When multiple pairs are declared, the caller is permitted access if passing any of the criteria. A script.accessDenied.acl
Fault
is thrown if all checks fail. To create an and style check, stack multiple @acl
decorators.
@acl( type, options, ... )
Arguments
type
{ String } Options object. One of (account, role, assert).options
{ * }For
account
{ String[] | ObjectID[] } An account id or email list that's allowed access.For
role
{ ObjectID[] } A role identifier list.For
assert
{ Function } A function that takes the calling principal and the methods arguments and must returna "truey" value to allow access. (`function(principal, arg1, args, ...) { return true })
Last updated