fix(web): limit protocol managers to active region leaders
Provide tenant-scoped leader options for the Web protocol form, exclude ordinary members and retain historical names only for display. Default only to a leader of the selected region and prevent delayed requests from replacing manual choices. Refs #1. Add backend option isolation and Web cascade regression coverage.
This commit is contained in:
1 parent
f6cfce3315
commit
d1347e8cea
6 files changed
+300
-61
No files matched your search
@@ -14,6 +14,7 @@ from app.core.menu_guard import require_admin_or_super_admin
|
||||
from app.core.response import error_response, success_response
|
||||
from app.core.utils import parse_datetime
|
||||
from app.crud import collection_protocol as cp_svc
|
||||
from app.crud import collection_region as region_svc
|
||||
from app.models.models import (
|
||||
BizCollectionProtocol,
|
||||
BizProtocolPartyCustomer,
|
||||
@@ -146,6 +147,15 @@ async def list_collection_protocols(
|
||||
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
|
||||
|
||||
|
||||
@router.get("/collection-protocols/region-managers")
|
||||
async def list_protocol_region_managers(
|
||||
user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
tenant_no = _get_tenant_no(db, user)
|
||||
return success_response({"list": region_svc.list_active_region_leaders(db, tenant_no=tenant_no)})
|
||||
|
||||
|
||||
@router.get("/collection-protocols/{protocol_id}")
|
||||
async def get_collection_protocol_detail(
|
||||
protocol_id: str,
|
||||
|
||||
Reference in new issue
Block a user