-
Notifications
You must be signed in to change notification settings - Fork 13
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
Authorizer contract needs separate methods for show-related and show-relationship actions #6
Comments
"No" is the answer. The two are answering different questions. The index action for the The show As you can see, the questions are different, which is why they need separate authorisation methods. |
No, maybe the index was a poor choice but the problem is Edit: Ok maybe I am overthinking it |
Ok, so the title of this issue and the description were a bit misleading! Effectively you're asking for show related and show relationship to have separate authorization methods on the interface. I'd be happy to make that change - however I would keep our default implementation doing the same thing i.e. using the same method on the policy to authorize both. However, by adding the additional method to the authorizer interface, you would have the opportunity to do things different by writing your own authorizer (or extending ours, and just overloading the single method you needed to change). The reason for not wanting to change our default implementation is I would not want to force people to implement two methods on their policy for something that is done as one method at the moment. Particularly because in most apps, the logic for reading the relationship (whether it is the relates resources or the relationship identifiers) is identical. I'm very limited on time at the moment, and this change won't be a priority for me as I won't need it in any of the apps I work on. Can you submit a PR? |
core/src/Contracts/Auth/Authorizer.php
Line 79 in b8faaca
lets assume we have a companySchema and branchSchema and they have a m-t-m relationship
lets also assume that a user has permission to 'index', 'show', 'showRelationship' of the branchSchema but does not have any permissions to the companySchema using the Authorizer.
if that user used the url: domain.com/api/v1/branches/{branch_id}/companies he will be able to see the data of each company ?
The text was updated successfully, but these errors were encountered: