Files
ai-agent/backend/authz/__init__.py
gabrielvidalandClaude Opus 5.5 c7da0f5008 feat(authz): roles, scoped credentials and one permission table for every route
- authz/catalog.py: 42 named permissions in groups and tiers (person, admin,
  host); authz/roles.py: built-in Operator (the owner), Admin (assignable with
  team mode), Member, Guest, Viewer + custom clones, in roles.json
- a person = role + allow/deny overrides (authz/policy.py); users.json's old
  switches (cli, mcp, createProjects, scratchBash, codeMode,
  computers.enabled) migrate once to exactly what they allowed, backup kept
- authz/scopes.py: what a credential acting for someone keeps (cli,
  worker.read|run, bot, phone) — a scope only narrows
- authz/routes.py: (method, path) -> permission for all 310 /api routes; the
  gate asks Caller.allows() for every caller kind, replacing GUEST_ROUTES,
  CLI_ROUTES and the worker READ/RUN_ROUTES regex lists
- golden route x caller matrix (authz/matrix.golden.txt, test_authz_matrix)
- the claude bot reads the admin app minus people/security/the machine; the
  phone key reads its unread notifications only
- loopback without the host token is logged (loopback_tokenless), refusals
  are perm_denied lines; the hub's own MCP calls send the token
- /api/roles CRUD, /api/me and /api/users carry role/allow/deny/perms
- worker-bound scheduled items and conversation-meta respect the binding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:59:05 +01:00

3 lines
118 B
Python

"""Who may do what: the permission catalog, roles, credential scopes and the
route table. See docs/permissions.md."""