seetook-acl

1.0.7 • Public • Published

node ACL use mongodb

Install

npm install seetook-acl --save-dev

API

newUser(String,String,Function)

the first argument is userMark name or id, the second argument is role name, the third is a callback with a argument of error

function callback(err){

}

newRole(String,Array[String],Array[String],Function)

  • String role name
  • Array resources name like:["blog","comment"]
  • Array like:["get","delete"]
  • callback(err)

hasRight(String,String,Array,Function)

  • String userMark
  • String resource name
  • Array[Actions:String]
  • callback(err)

removeUser(username:String,callback:Function(err))

removeRole(rolename:String,callback:Function(err))

getUserRoles(username:String,callback:Function(err,Array[rolename:String]))

getRoleUsers(rolename:String,callback:Function(err,Array[rolename:String]))

Readme

Keywords

none

Package Sidebar

Install

npm i seetook-acl

Weekly Downloads

0

Version

1.0.7

License

ISC

Last publish

Collaborators

  • koopos