node package manager

auth-permission

Represent a permission having an action and resource.

auth-permission

Represent a permission having an action and resource.

Installation

Node

npm install auth-permission

Browser

component install alexmingoia/auth-permission

Example

var Permission = require('auth-permission');
 
var permission = new Permission('read', 'forum');

API

Permission(action, resource)

Creates a new Permission with given action and resource.

permission.name()

var permission = new Permission('read', 'forum');
 
permission.name();
// => "read forum" 

permission.action()

permission.resource()

MIT Licensed