Permissions (durin.permissions)
Durin provides two abstract permission classes which
make use of the durin.models.Client
model it offers.
You will need to subclass them and modify the
allowed_clients_name or disallowed_clients_name property per your wish.
Then you may use them the same way as other
DRF permissions or
activate them on all your views by adding
them to REST_FRAMEWORK["DEFAULT_PERMISSION_CLASSES"]
under your app’s settings.py
AllowSpecificClients
-
class
durin.permissions.AllowSpecificClients[source] Bases:
rest_framework.permissions.BasePermissionAllows access to only specific clients.
Should be used along with Authentication (durin.auth).
-
allowed_clients_name= () Include names of allowed clients to
allowed_clients_name.
-
DisallowSpecificClients
-
class
durin.permissions.DisallowSpecificClients[source] Bases:
rest_framework.permissions.BasePermissionRestrict specific clients from making requests.
Should be used along with Authentication (durin.auth).
-
disallowed_clients_name= () Include names of disallowed clients to
disallowed_clients_name.
-