v0.8测试
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user