auth-role
v0.1.0
Published
Create named collections of permissions.
Downloads
3
Readme
auth-role
Create named collections of permissions.
Installation
Node
npm install auth-role
Browser
component install alexmingoia/auth-role
Example
var Permission = require('auth-permission');
var Role = require('auth-role');
var role = new Role('member');
role
.allow(Permission('read', 'forum'))
.allow(Permission('create', 'thread'));
API
Role(name)
Create a new Role with given name
.
role.allow(permission)
Allow given permission.
role.name()
Return the name of the role.
role.permissions()
Return the role's allowed permissions.