-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
Add role based authorization #158
Comments
My current approach has been as follows:
This has been working for me in my apps, but I'm not sure if it can be generalized for every use case. |
Hi @lynndylanhurley, I just stumbled across the same requirement / issue. I understand your suggestion, however from an implementation standpoint I am struggling with (1). How does one modify the user object which is being returned by devise for both sign_in as well as validate_token? I am sure it has been asked before, but I could not find it. Basically in my case I have the "User" class and a "UserRole" class which roughly represents your "permissions" in the example above. So I would expect a return JSON object along these lines: Any suggestions on how I tie in the relation? |
@pommerien - just override the The method to override is here. |
@lynndylanhurley overriding cc: @pommerien |
I know this is not the purpose of this gem, but if you had to implement it to work with
ng-token-auth
, how would you do that ?I'm working on a project based on this Gem, and I will need authorization for the iOs / Android app and later, the website.
The text was updated successfully, but these errors were encountered: