Does get_permissions() overrides @action(permission_classes=[...]) ? #8787
Unanswered
FMZPNP
asked this question in
Question & Answer
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.
-
Hello, I have the following issue in a ViewSet. It's just an example but it is accurate at what I have.
I have it in that way because we're thinking to set the permission policy per standard action (create, update, partial_update, destroy, list, retrieve) with the
get_permissions
method. And later be more specific in some actions, setting the permission policy in the decorator itself.When I debug, my action has the correct permission_classes:
IsAdminUser
; but in reality it is taking only the remaining permission on theget_permission
method:ÌsAuthenticated
In the docs it says that the decorator
@action(permission_classes=...)
overrides the ViewSet attribute, but it doesn't say anything about the methodget_permissions
.Beta Was this translation helpful? Give feedback.
All reactions