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
durin.permissions.
AllowSpecificClients
[source]ï
Bases: rest_framework.permissions.BasePermission
Allows 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
.
has_permission
(request, view)[source]ï
Return True if permission is granted, False otherwise.
durin.permissions.
DisallowSpecificClients
[source]ï
Bases: rest_framework.permissions.BasePermission
Restrict 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
.
has_permission
(request, view)[source]ï
Return True if permission is granted, False otherwise.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4