1.0.9 • Published 8 years ago

ubac v1.0.9

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

UBAC

(User & Role Based Access Control)

UBAC is the authorization library for NodeJS. It also contains user management functions, like registor,login and other basic functions. You can simply build a variety of systems based on it. Almost all methods based on promise, to achieve q.js

Documentation

UBAC Controller User Role Permission Resource Operation

Other Util Cache Data

Model

At present, only the MySQL model is provided.

Install

npm install ubac

Initialize

ubac.init({ model : { name : 'mysql', //model name rebuild : true, //if rebuild the database connect : { //connect connectionLimit : 10, host : 'localhost', database : 'test', user : 'root', password : '', port : '3306' } } });

Usage

var ubac = require('ubac');

ubac.login({'account':'test', 'password':'abc123'}) .then(function(userInfo){ console.log(userInfo); });

ubac.can(1, "create_news") .then(function(result){ console.log(result); });

...

Running Tests

first install mocha npm install -g mocha

then run it mocha

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago