-
Notifications
You must be signed in to change notification settings - Fork 60
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
Skip authorization for included resources #141
Comments
Sorry, I don't really understand what you mean by "still want each resource to be authorized separately". Can you give some examples of what you'd like to authorize in some scenarios? |
@valscion for example when I do the following "/trips?include=driver" I don't want the driver resource to be authorized. However; if I did "/drivers" I want it to be authorized. So basically I want to skip authorization for relationships when I include them |
Not that I really understand why you'd want to do it, it's still possible 😄. You can implement a custom authorizer class that subclasses from the jsonapi-authorization/lib/jsonapi/authorization/default_pundit_authorizer.rb Lines 227 to 263 in 761545b
Then configure That will not stop the
Note that these approaches will require careful review if we at some point get to do a new release of |
@valscion I want some fields from the relationships just for displaying information on a certain page, but I want to restrict the resource itself. Thank you so much, will try it out. |
👍 I'll close this issue now as the discussion seems settled to me. |
Hey!
I'm trying to skip authorization for the included resources, but still, I want each resource to be authorized separately. Does that make sense? and is that even possible?
The text was updated successfully, but these errors were encountered: