Javascript library for the implementation of role based access control in a web application.
The data type 'permission' is defined as follows:
var whatever_permission = { r: $resource, a: $action }
- Where $resource is a string naming a resource e.g. Domain
- Where $action is a string naming an action e.g. Create
The data type 'role' is defined as follows:
var whatever_role = {
a: true | false
,p: [$permission1, $permission2, ...]
};
Where 'a' represents the 'admin' flag. When 'true', this role conveys all permissions.
The data type 'user' is defined as follows:
var whatever_user = { roles: [$role1, $role2, ...], ... };
As long as the object passed contains the key 'roles', it is considered a 'user' instance.
This project complements the following https://github.com/jldupont/pyrbac.