v0.8测试

This commit is contained in:
2026-04-16 07:55:46 +08:00
parent 7c743293be
commit c8262cf92e
16 changed files with 84 additions and 39 deletions

View File

@@ -77,6 +77,12 @@ class PermissionChecker:
role = await PermissionChecker.get_user_role(user_id)
return role == "劳动委员"
@staticmethod
async def check_is_volunteer_rep(user_id: int) -> bool:
"""检查是否为志愿委员"""
role = await PermissionChecker.get_user_role(user_id)
return role == "志愿委员"
@staticmethod
async def check_can_manage_subjects(user_id: int) -> bool:
"""检查是否可以管理科目(班主任或学习委员)"""
@@ -127,7 +133,7 @@ class PermissionChecker:
if not record:
return False
role = await PermissionChecker.get_user_role(user_id)
if role in ["班主任", "班长"]:
if role in ["班主任", "班长", "志愿委员"]:
return True
return record["recorder_id"] == user_id