Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
761 B
Python
28 lines
761 B
Python
"""Permission catalog discovery API — Phase 10.1."""
|
|
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from app.api.permissions import require_permissions
|
|
from app.permissions.definitions import (
|
|
ALL_PERMISSIONS,
|
|
DELIVERY_VIEW,
|
|
PERMISSION_PREFIXES,
|
|
)
|
|
from shared.security import CurrentUser
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/catalog")
|
|
async def permission_catalog(
|
|
_user: CurrentUser = Depends(require_permissions(DELIVERY_VIEW)),
|
|
):
|
|
"""Static permission discovery for Identity / admin consoles."""
|
|
return {
|
|
"prefix": "delivery.",
|
|
"prefixes": list(PERMISSION_PREFIXES),
|
|
"permissions": list(ALL_PERMISSIONS),
|
|
"count": len(ALL_PERMISSIONS),
|
|
}
|