Issue with ViewSet permissions #8679
Unanswered
jzr-supove
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
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed an issue related with showing custom permission messages.
Lets say I have a
FooPermissionpermission class:and
FooViewSet:I have Session and JWT authentication classes and AllowAny permission class enabled in my DRF settings:
When I try to access
/fooendpoint (list view), I get:{"detail": "Authentication credentials were not provided."}but I was supposed to get the message that I've defined in my permission class, no?
{"detail": "Custom message"}I get that there is authentication class raising this error, but when I change the return value of
FooPermission.has_permissionmethod toTrue, it works okay and no authentication class is involved in the process and checking for authentication credentials.Beta Was this translation helpful? Give feedback.
All reactions