清理全局角色残留并修复项目权限判断

This commit is contained in:
Cheng Zhou
2026-05-29 10:20:42 +08:00
parent 63457aab11
commit 44d69c2d7b
63 changed files with 739 additions and 443 deletions
+4 -3
View File
@@ -6,6 +6,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.core.deps import (
get_current_user,
get_db_session,
get_operator_role_label,
require_study_not_locked,
require_api_permission,
)
@@ -120,7 +121,7 @@ async def create_subject_pd(
action="CREATE_SUBJECT_PD",
detail=f"PD记录 {item.pd_no} 已创建",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return SubjectPdRead.model_validate(item)
@@ -167,7 +168,7 @@ async def update_subject_pd(
action="UPDATE_SUBJECT_PD",
detail=f"PD记录 {updated.pd_no} 已更新",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return SubjectPdRead.model_validate(updated)
@@ -201,5 +202,5 @@ async def delete_subject_pd(
action="DELETE_SUBJECT_PD",
detail=f"PD记录 {item.pd_no} 已删除",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)