Skip to content

Copilot — permissions

Returned by CopilotModule.get_permissions() (relative names; the registry namespaces them as copilot.<name>).

PermissionAllowsRequired by
copilot.chatStart/continue a chat session, confirm pending writes, and read the Pendientes feed + nudges.POST /sessions, POST /sessions/{id}/messages, POST /sessions/{id}/confirmations/{cid}, POST /sessions/{id}/end, GET /pending, GET /nudges, POST /nudges/{id}/dismiss
copilot.history.readReplay one's own conversations.GET /sessions, GET /sessions/{id}/messages
copilot.history.read_allList/replay other users' conversations (supervisor view).GET /sessions (cross-user)
copilot.superviseRead usage observability (tool-call counts, error rate, latency, token budget).GET /metrics
copilot.configureRead/update per-clinic provider, budget and digest settings.GET /settings, PATCH /settings

Role assignment

See backend/app/core/auth/permissions.py for the canonical role table.

Adding a new permission

  1. Add the relative name to get_permissions() in backend/app/modules/copilot/__init__.py (or module.py).
  2. Add the namespaced form to the relevant role(s) in backend/app/core/auth/permissions.py.
  3. Add a row to the table above.
  4. Annotate the endpoint(s) with Depends(require_permission(...)).
  5. Update frontend/app/config/permissions.ts if it gates UI.