auth-role

0.1.0 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i auth-role

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • amingoia