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

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_cra_site_scope, get_current_user, get_db_session, require_study_not_locked, require_api_permission
from app.core.deps import get_operator_role_label, get_cra_site_scope, 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 drug_shipment as shipment_crud
from app.crud import site as site_crud
@@ -56,7 +56,7 @@ async def create_shipment(
action="CREATE_DRUG_SHIPMENT",
detail=f"药品运输 {shipment.id} 已创建",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return DrugShipmentRead.model_validate(shipment)
@@ -152,7 +152,7 @@ async def update_shipment(
action="UPDATE_DRUG_SHIPMENT",
detail=f"药品运输 {shipment_id} 已更新",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)
return DrugShipmentRead.model_validate(shipment)
@@ -185,5 +185,5 @@ async def delete_shipment(
action="DELETE_DRUG_SHIPMENT",
detail=f"药品运输 {shipment_id} 已删除",
operator_id=current_user.id,
operator_role=current_user.role,
operator_role=await get_operator_role_label(db, study_id, current_user),
)