We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roles have permissions, permissions map to validator functions
example:
function validate(req) { if (!req.valid) { return false; // should this throw an error? } return true; }
validator functions are defined in 3 places and take the following precedence (lowest to highest)
'user.get': function validate(req) { return permissions[req.role].indcludes('user.get'); }
'user.get9to5': function validate(req) { return permissions[req.role].indcludes('user.get') && timeofday > 9 && timeofday < 5; }
router.get('/:id', permission.middleware(['user.get', 'user.self'], { 'user.self': function(req) { return req.params.id === req.userId; } }), function(req, res, next) { // route } )
The text was updated successfully, but these errors were encountered:
gurpreetatwal
No branches or pull requests
roles have permissions, permissions map to validator functions
example:
validator functions are defined in 3 places and take the following precedence (lowest to highest)
The text was updated successfully, but these errors were encountered: