-
Notifications
You must be signed in to change notification settings - Fork 145
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 raise_exception
arg to @group_required
#10658
Comments
jacobtylerwalls
added a commit
that referenced
this issue
Mar 6, 2024
Allows raising a 403 PermissionDenied for API-style requests, instead of a 302 redirect to nowhere.
jacobtylerwalls
added a commit
that referenced
this issue
Mar 6, 2024
6 tasks
jacobtylerwalls
added a commit
that referenced
this issue
Mar 14, 2024
6 tasks
apeters
added a commit
that referenced
this issue
Mar 19, 2024
Add raise_exception arg to @group_required #10658
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
@group_required
decorator for permission checking will, when the user fails the test, redirect to nowhere with status 302.This is fine for requests to views that render templates. But for views that return JSON payloads, I'm suggesting that better than a 302 redirect is a 403 permission denied code.
We found in AfS that returning 3xx instead of 4xx error codes resulted in no error banner in knockout components.
Will open a PR to illustrate the idea.
The text was updated successfully, but these errors were encountered: