-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Follow policy response status for resource authorization #6786
Follow policy response status for resource authorization #6786
Conversation
Signed-off-by: Julio Motol <julio.motol89@gmail.com>
This is a breaking change and I don't really understand why we need to duplicate the gate code that was already in another method ( |
The On the other hand
Should I introduce a new method rather than modifying the |
I think we should just change it to 404 all the time |
Gotcha, I'll create a new PR later |
I don't agree. I think we should use the actual status code that's set on the auth exception from e.g. the policy. |
@zepfietje We can't stop using |
I haven't looked into the specifics, but I think there's more use cases than just returning 404. E.g. when returning the |
Response::denyAsNotFound()
Since this is a breaking change, we will have to deal with it in v3. I will do the work for that. Thanks @juliomotol! |
Looking forward to see this in v3, thank you! |
This PR aims to respect Laravel's
Response::denyAsNotFound()
usage withinPolicy
classes.Before, regardless of how we try to specify the status to 404, it still responds with a 403 as that is hardcoded to abort to.