fix: 俱乐部分配任职仅集团高层可操作

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-06 18:06:37 +08:00
parent 1dfb46c38c
commit 2573db1bbf

View File

@@ -503,13 +503,15 @@ class GetAdminUserListView(APIView):
'UpdateTime': user.KefuProfile.UpdateTime.strftime('%Y-%m-%d %H:%M:%S') if getattr(user.KefuProfile, 'UpdateTime', None) else '',
})
from jituan.services.admin_context import can_manage_admin_assignments
return Response({
'code': 0,
'data': {
'list': data_list,
'total': paginator.count,
'page': page,
'pageSize': page_size
'pageSize': page_size,
'can_manage_club_assignments': can_manage_admin_assignments(request.user, permissions),
}
})
@@ -641,7 +643,14 @@ class ModifyAdminUserView(APIView):
kefu, permissions = verify_kefu_permission(request, username)
if kefu is None:
return permissions
if '000001' not in permissions:
from jituan.services.admin_context import can_manage_admin_assignments
club_assign_actions = {'add_club_assignment', 'remove_club_assignment'}
if action in club_assign_actions:
if not can_manage_admin_assignments(request.user, permissions):
return Response({'code': 403, 'msg': '仅集团高层(集团总负责人/集团超管)可分配俱乐部任职'})
elif '000001' not in permissions:
return Response({'code': 403, 'msg': '您无权进行此操作'})
target_yonghuid = request.data.get('yonghuid', '').strip()