Skip to content
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

fix anonymous access for DjangoModelPermissionsOrAnonReadOnly #9315

Closed
wants to merge 2 commits into from

Conversation

farnswj1
Copy link

This pull request fixes anonymous read-only access for the DjangoModelPermissionsOrAnonReadOnly class in permissions.py as mentioned in issue #9299.

If the user is authenticated, it will run the the has_permission method defined in DjangoModelPermissions since it's the parent class. If the user is not authenticated, then the user will have permission only if the method is safe. (GET, HEAD, or OPTIONS)

@auvipy
Copy link
Member

auvipy commented Mar 20, 2024

Is it possible to add some tests to verify this?

@farnswj1
Copy link
Author

Is it possible to add some tests to verify this?

Yes. I've included them in the latest commit

@tomchristie
Copy link
Member

tomchristie commented Mar 21, 2024

Superseeded by #9332, which instead outright reverts the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants