Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Create named collections of permissions.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
README.md
component.json
package.json

README.md

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

Something went wrong with that request. Please try again.