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

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 -4
View File
@@ -3,7 +3,7 @@ import uuid
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.deps import get_current_user, get_db_session, require_study_not_locked, require_api_permission
from app.core.deps import get_operator_role_label, get_current_user, get_db_session, require_study_not_locked, require_api_permission
from app.crud import audit as audit_crud
from app.crud import site as site_crud
from app.crud import subject as subject_crud
@@ -58,7 +58,7 @@ async def create_history(
action="CREATE_SUBJECT_HISTORY",
detail="病史记录已创建",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return SubjectHistoryRead.model_validate(history)
@@ -133,7 +133,7 @@ async def update_history(
action="UPDATE_SUBJECT_HISTORY",
detail="病史记录已更新",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return SubjectHistoryRead.model_validate(history)
@@ -166,5 +166,5 @@ async def delete_history(
action="DELETE_SUBJECT_HISTORY",
detail="病史记录已删除",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)