Django Rest Framework wont let me have more than one permission
|July 22, 2014||Posted by forumadmin under TechQns||
I have a problem with the Django Rest Framework and permissions. DRF won’t let me have more than one permission on my views for example.
If I login to the API as an admin user I can get access using this mixin:
class PermissionMixin(object): permission_classes = (permissions.IsAdminUser)
Now, if I add a second permission mixin:
class PermissionMixin(object): permission_classes = (permissions.IsAdminUser, TokenHasReadWriteScope)
Admin users are denied access. What should happen is both admin user and users with a token get access, however with above now only TokenHasReadWriteScope users have access.
Has anyone else had this issue, whats going on here?
I need both type of users to have access.
This is how my view looks:
class SomeList(PermissionMixin, generics.ListCreateAPIView) queryset = Award.objects.all() serializer_class = AwardSerializer
PS TokenHasReadWriteScope is from django-oauth-toolkit
|Asked By – Spike||Read Answers|