1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-28 16:08:25 +00:00
seahub/base/decorators.py

13 lines
320 B
Python
Raw Normal View History

2012-08-06 02:58:34 +00:00
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