mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
feat(security): apply Codex review hardening to console tokens and superuser authorization
This commit is contained in:
parent
1227674d8f
commit
708b986e8e
11 changed files with 168 additions and 26 deletions
|
|
@ -1,7 +1,9 @@
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue