permissions.DjangoModelPermissionsOrAnonReadOnly
doesn't actually enable anonymous read-only access in 3.15
#9298
Unanswered
lpomfrey
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the title states, it seems from DRF 3.15 the
permissions.DjangoModelPermissionsOrAnonReadOnly
doesn't actually allow anonymous read only access as it inherits the check for the view permission on the model frompermissions.DjangoModelPermissions
class.It would seem to replicate the older behaviour
DjangoModelPermissionsOrAnonReadOnly
should set'GET'
and'HEAD'
in theperms_map
to[]
(along with settingauthenticated_users_only = False
).I'm not sure if this is by design and the recommended solution is to compose a set of permissions like
permissions.DjangoModelPermissions | ReadOnly
(providing a customReadOnly
class), but the documentation still suggests it should work as it did in 3.14 and before.Beta Was this translation helpful? Give feedback.
All reactions