Include a IsSuperUser
within the permissions.py
#9746
Unanswered
robotichead
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
Seems slightly niche to me, and the implementation is pretty simple if one needs to implement it themselves. One the other hand, it's so simple that it's tempting to add. At first glance, I'm on the fence... Feels a bit wrong to encourage exposing super-users / staff distinction in the APIs. I'll think about it more. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Before I start, I have read the following tickets;
And I do agree with the outcome of these tickets. tldr;
We have a specific case where we only want super users to access a certain API node. We don't want "is_staff" users to access it, only "is_superusers". The fix for us at the moment is the following code;
This has clearly been copied from-
django-rest-framework/rest_framework/permissions.py
Line 154 in 2ae8c11
Should a permission like this be included within the Django-Rest-Framework, or are we a special case?
Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions