I would like to integrate roles in my NodeJS/ExpressJS REST API app.
I currently use a rule to automatically retrieve from user login the email associated with the authentication method (I have enabled: Facebook, Twitter and Google Social connections).
I know that I can use
to handle scopes as in this example code.
But in this way, I can enable or disable altogether a REST endpoint based on user scope.
How can I instead:
- enable or disable the endpoint using user Role (not scope)
- retrieve user role name and redirect to different routes
Thanks in advance.