1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

Modified group adding member

This commit is contained in:
zhengxie
2012-10-22 11:54:06 +08:00
parent d9bbed6f04
commit 4ac81a4524
5 changed files with 108 additions and 67 deletions

17
group/decorators.py Normal file
View File

@@ -0,0 +1,17 @@
from django.http import Http404
from seaserv import check_group_staff
def group_staff_required(func):
"""
Decorator for views that checks the user is group staff.
"""
def _decorated(request, *args, **kwargs):
group_id = int(kwargs.get('group_id', '0')) # Checked by URL Conf
if check_group_staff(group_id, request.user):
return func(request, *args, **kwargs)
raise Http404
return _decorated