Use 403 when actions are forbidden, not 401 #2846
Merged
Conversation
Contributor
Author
|
This change won't fix extensions that have copied ckan controller code and still use It's not clear to me what the IAuthenticator abort() method it intended for. Does it allow a redirect or some other action? If so, because a number of _show calls for unauthorized users are now 404's instead of 401's that could cause more breakage |
Contributor
|
This PR seems to fix any issues I've had regarding spontaneous logouts. |
Contributor
Author
|
@nigelbabu thanks! I'll look into the test failures, possibly some new tests added since I created this PR |
FuhuXia
added a commit
to GSA/ckanext-harvest
that referenced
this pull request
Mar 13, 2023
following ckan core ckan/ckan#2846
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
401 is for when a user can't authenticate. All our current 401 errors are causing users to be logged out by repoze (which is reasonable). Instead we want to say "yes, I know who you are, you just aren't allowed to access this page"