sails-hook-rbac-helper
v0.0.5
Published
sails js hook, rbac helper
Downloads
23
Readme
Configuration
module.export.rbac = {
useMiddleware : true // default false,
middleware: (req, res,next) => {
next()
} // optional, middleware function...
controls: {
'POST /members': {
roles: [ 'hr_manager'],
groups: ['admin'],
permissions: ['create'],
isLoggedIn: true // optional, default undefined
},
}
}
// object 'req.rbac' has been bind to router with control data after hook initialized
// could be compared manually in policies file, or create compare logic in custom middleware
// hookName: rbac