1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00
Files
seahub/base/decorators.py
2012-08-16 10:48:59 +08:00

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