Skip to content

Instantly share code, notes, and snippets.

@yashprit
Last active August 29, 2015 14:05
Show Gist options
  • Save yashprit/4050fbc734fb2d184889 to your computer and use it in GitHub Desktop.
Save yashprit/4050fbc734fb2d184889 to your computer and use it in GitHub Desktop.
var authorised = module.exports = function(req, res, next) {
//check for cdc token
return function(role) {
//check roles with userid in userRoleLookupTable
}
};
var access = authorised();
app.get("/admin", access('admin'), foo.list);
app.get("/user", access('user'), foo.show);
app.get("/all", access('all'), foo.get)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment