1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/admin/permissions.py

15 lines
381 B
Python

from rest_framework.permissions import BasePermission
class IsSuperUser(BasePermission):
"""
Allows access only to active superusers.
"""
def has_permission(self, request, view):
return bool(
request.user
and request.user.is_authenticated
and request.user.is_active
and request.user.is_superuser
)