auth-role

Create named collections of permissions.

npm install auth-role
3 downloads in the last day
5 downloads in the last week
11 downloads in the last month

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.

MIT Licensed

npm loves you