SSARV
Stupidly Simple Account Role Verifier - Express middleware that checks if the user has the correct permission role.
Install
npm install ssarv
Use:
For use with express.
Syntex
ssarv(requiredRoles, opt)
"requiredRoles" is an array of roles allowed
"opt" is a json object. Current valid "opt" keys:
opt = {
locationOfRoles: "req.user.perm.role", //(required)
failureRedirect: "/auth/login" //(optional)
}
Example:
//express stuff here var ssarv = ; app;