Permission class based on action #8437
Unanswered
arayik-yervandyan
asked this question in
Ideas & Suggestions
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.
-
A lot of times in my experience I had to limit access to view actions based on user role. Django-rest-framework supports only permission classes on the entire view class, so I used to add custom implementation for limiting access to the action.
Currently, I am using the StackOverflow answer with some modifications.
Usage is like this
permission_classes_by_action = {'list': [IsAdmin ]}
I would like to create a PR to implement this logic and give the ability to users to limit access to actions based on roles
Questions?
P.S. This is my first contribution attempt so please guide me if I am posting this in the wrong way or at the wrong time 😄
Beta Was this translation helpful? Give feedback.
All reactions