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
sails-hook-rbac-helper
0.0.5 • Public • PublishedPackage Sidebar
Install
npm i sails-hook-rbac-helper
Weekly Downloads
3
Version
0.0.5
License
ISC
Unpacked Size
2.85 kB
Total Files
6