fix: restore historical order visibility for HartOMat admins

This commit is contained in:
2026-04-06 19:24:09 +02:00
parent f13cb489c1
commit 2a00abe91f
6 changed files with 19 additions and 7 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ from app.models.cad_file import CadFile
from app.models.order import Order, OrderStatus
from app.models.order_item import OrderItem, ItemStatus
from app.models.user import User
from app.domains.auth.models import PM_ROLES
from app.schemas.order import OrderItemOut
from app.utils.auth import get_current_user
@@ -25,7 +26,7 @@ router = APIRouter(prefix="/orders", tags=["order_items"])
# ---------------------------------------------------------------------------
def _is_privileged(user: User) -> bool:
return user.role.value in ("admin", "project_manager")
return user.role.value in PM_ROLES
async def _get_order_and_item(