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
What about something like this in index.js? (This is not the most elegant algorithm nor did I run it yet. It's just an idea at this point.)
if (req.isAuthenticated()) { if (!roles || roles.indexOf(req.user[role]) > -1){ after(req, res, next, permission.AUTHORIZED); } else if (req.user[role].hasProperty('forEach)) { var perm = permission.NOT_AUTHORIZED; req.user[role].forEach(function(userRole, i){ if(!roles || roles.indexOf(userRole) > -1) perm = permission.AUTHORIZED; } after(req, res, next, perm); } else { after(req, res, next, permission.NOT_AUTHORIZED); } } else { after(req, res, next, permission.NOT_AUTHENTICATED); }
The text was updated successfully, but these errors were encountered:
Hey, sorry for not answering soon enough. I'll take a look into it these days.
Sorry, something went wrong.
It would be nice with combination of mongodb's built-in roles and access grunts.
it's added
No branches or pull requests
What about something like this in index.js? (This is not the most elegant algorithm nor did I run it yet. It's just an idea at this point.)
The text was updated successfully, but these errors were encountered: