mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
12 lines
321 B
Python
12 lines
321 B
Python
from functools import wraps
|
|
from django.core.exceptions import PermissionDenied
|
|
|
|
|
|
def superuser_only(function):
|
|
@wraps(function)
|
|
def _inner(request, *args, **kwargs):
|
|
if not request.user.is_superuser:
|
|
raise PermissionDenied
|
|
return function(request, *args, **kwargs)
|
|
|
|
return _inner
|