mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Merge 1f00ea5a8f
into 8f6173cd8a
This commit is contained in:
commit
68d1de03bb
|
@ -57,7 +57,16 @@ class IsAdminUser(BasePermission):
|
||||||
|
|
||||||
def has_permission(self, request, view):
|
def has_permission(self, request, view):
|
||||||
return request.user and request.user.is_staff
|
return request.user and request.user.is_staff
|
||||||
|
|
||||||
|
|
||||||
|
class IsSuperUser(BasePermission):
|
||||||
|
"""
|
||||||
|
Allows access only to superuser users.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def has_permission(self, request, view):
|
||||||
|
return request.user and request.user.is_superuser
|
||||||
|
|
||||||
|
|
||||||
class IsAuthenticatedOrReadOnly(BasePermission):
|
class IsAuthenticatedOrReadOnly(BasePermission):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user