Identical to behavior of req.context.ifLoggedIn and req.context.ifNotLoggedIn. API would look something like this:
req.context.ifAuthorized('role_to_check', '/route-if-has-role', () => {
// Do this if they do not have the role.
});
req.context.ifNotAuthorized('role_to_check', '/route-if-not-has-role', () => {
// Do this if they have the role.
});
Just need to account for NoSQL vs SQL queries when checking roles.
Identical to behavior of
req.context.ifLoggedIn
andreq.context.ifNotLoggedIn
. API would look something like this:Just need to account for NoSQL vs SQL queries when checking roles.