djangodjango-permissions

DRF Model Permission denying access to authenticated user


I'm getting a permission denial error but, if I'm understanding things correctly, the permissions should already have been assigned.

Checking the permission content

Granting the permissions through shell

Postman endpoint

class UserList(generics.ListCreateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
permission_classes = [DjangoModelPermissions]

class UserDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
permission_classes = [DjangoModelPermissions]

I've tried some different permission classes so far, but except for just bypassing it entirely with AllowAny nothing seems to have worked.


Solution

  • Managed it. The problem was with the JWT auth. I was using JWTStatelessUserAuthentication, switched it to JWTAuthentication in the settings and it seems to be working as expected now.