0.0.5 • Published 3 years ago

sails-hook-rbac-helper v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago