mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
13 lines
320 B
Python
13 lines
320 B
Python
from django.http import Http404
|
|
|
|
def sys_staff_required(func):
|
|
"""
|
|
Decorator for views that checks the user is system staff.
|
|
"""
|
|
def _decorated(request, *args, **kwargs):
|
|
if request.user.is_staff:
|
|
return func(request, *args, **kwargs)
|
|
raise Http404
|
|
return _decorated
|
|
|