1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-12 00:15:19 +00:00
webvirtcloud/admin/decorators.py

11 lines
272 B
Python
Raw Normal View History

from django.core.exceptions import PermissionDenied
def superuser_only(function):
def _inner(request, *args, **kwargs):
if not request.user.is_superuser:
raise PermissionDenied
return function(request, *args, **kwargs)
return _inner