Gurkenkönig
Gurkenkönig

Reputation: 828

How to make Django REST User API with complex permissions

I want to make a Django REST User API with complex permissions as follows:

GET

PUT

POST / DELETE

Unfortunately, I have no idea how to control the view or serializer to allow such permissions. Is there a template how I can exactly control the permissions?

Upvotes: 0

Views: 215

Answers (1)

Sergey Pugach
Sergey Pugach

Reputation: 5669

You can write your custom permission according to DRF docs.

And add YourCustomPermission in your view:

class ExampleView(APIView):
    permission_classes = (YourCustomPermission,)

Upvotes: 2

Related Questions