"""Two routers, because templates have two audiences. Everyone may READ the templates (the picker needs them); only an admin may change what the instance offers. Expressing that as two constructors means a new endpoint is gated by which router it is added to, not by remembering to repeat a dependency. """ from fastapi import APIRouter, Depends from app.auth.deps import require_admin def reader_router() -> APIRouter: return APIRouter(prefix="/templates", tags=["templates"]) def editor_router() -> APIRouter: return APIRouter( prefix="/templates", tags=["templates"], dependencies=[Depends(require_admin)] )