feat: update init users

This commit is contained in:
2026-06-13 13:21:53 +08:00
parent 05ce7e987e
commit 46761906fe
11 changed files with 502 additions and 430 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ class IsUserListPermitted(BasePermission):
user = request.user
if _is_admin(user):
return True
if user.role_type == 'teacher':
if user.role_type == 'doctor': # 带教医生:可看名下学生
return True
raise AppError('USER_NO_LIST_PERMISSION', '您没有查看用户列表的权限', status_code=403)
@@ -32,8 +32,8 @@ class IsUserDetailPermitted(BasePermission):
# 本人:可查看自己
if user.id == obj.id:
return True
# 教师:可查看自己名下活跃学生
if user.role_type == 'teacher':
# 带教医生:可查看自己名下活跃学生
if user.role_type == 'doctor':
if TeacherStudentRelation.objects.filter(
teacher=user, student=obj, status=1
).exists():