Class: Role

Role

new Role()

Source:

Methods

authorize(verbs, noun)

Authorizes this role to perform an array of actions on a verb

Parameters:
Name Type Description
verbs Array.<String> | String

Either an array of verbs already regestered with the noun, or '*' to allow access to all verbs

noun String
Source:
See:
Example
someRole.authorize(['create','read'], 'kitten');

can(verb, noun) → {boolean}

Checks if a given noun can perform a given verb

Parameters:
Name Type Description
verb string
noun string
Source:
Returns:
Type
boolean
Example
someRole.can('eat','brick'); // -> true