Skip to content

Latest commit

 

History

History
127 lines (95 loc) · 7.78 KB

CAPABILITIES.md

File metadata and controls

127 lines (95 loc) · 7.78 KB

Capability Taxonomy

Capabilities are the authorization vocabulary of the Frappe Cloud control plane. Central is the source of truth. It resolves a user's team grants into capability strings and enforces them before every regional or Pilot call.

The capability set lives in fixtures/capability.json and the default role assignments in fixtures/team_role.json. This document is the human-readable reference for that data.

A capability is named resource:action and belongs to exactly one plane:

Plane Owner Enforced in
central Central Central (central/permissions.py, Team doc methods)
atlas Atlas Central, before each regional call (central/utils/guards.py, central/iam.py)
bench each bench No capabilities on this plane today

Server is the atomic unit (model v9)

Role capabilities live at the team and server level only. A team manages servers, and a server is a bench host. The bench plane holds no capabilities. Bench tokens carry no capabilities today. The bench plane value stays on Capability, so site-level capabilities can return under it later. asset:view is not a capability, because server:view gates the Virtual Machine registry.

Vocabulary vs. roles

The distinction matters:

  • The vocabulary is the set of capability strings below. Central enforces it, and stored grants, fixtures, and the dashboard depend on it. It is small and changes rarely.
  • Roles (system roles and team-defined custom roles) are named subsets of that vocabulary. A custom role recombines existing capabilities. It never mints a new capability string. Teams can create as many custom roles as they like without an effect on this contract.

The 22 capabilities

central plane (13)

Capability Meaning
app:deploy Link GitHub Deploy App installations to the team and deploy apps from their repositories.
app:view View the team's deployed apps, their deploys, and each deploy's build and release logs.
billing:view View billing data.
billing:manage Manage billing settings and payment operations.
team:edit Edit team metadata.
team:manage_members Invite, suspend, and change team members.
team:delete Archive a team.
service:view View managed service configuration.
service:manage Create and delete storage buckets, set bucket quotas, rotate bucket credentials, and download, upload, and delete stored objects.
support:view Open support tickets and see your own. In Helpdesk the member is a Customer.
support:manage See every support ticket of the team. In Helpdesk the member is a Customer Manager.
server:ssh-key Add, rotate, and remove Team SSH keys for selected servers.
server:wireguard See, add, and remove team WireGuard devices that reach servers through the regional gateway. A member removes only their own devices unless they also hold team:manage_members.

atlas plane (9)

Capability Meaning
cluster:view View clusters the team can place servers in.
server:view List servers and sites; view status, specs, and metrics.
server:create Provision a new server.
server:power Start, stop, and restart a server.
server:network Change the firewall, public addresses, and WireGuard access of a server. A team-wide grant also manages the team's firewall rulesets.
server:resize Resize, rebuild, or rename a server.
server:snapshot Create and restore server snapshots.
server:terminate Destroy a server.
server:console Open the web console of a running server, and sign in to its bench or site as Administrator.

bench plane (0)

No capabilities are seeded on the bench plane in v9. Site-level management capabilities, such as site:view, site:create, or site:apps, would go here. Adding one needs an agreed bench token contract with Pilot first.

Capability implications

Acting on a resource is meaningless without seeing it. Central closes every grant under these implications before it asserts or evaluates the grant (central/iam.py):

Capability Implies
server:create server:view, cluster:view
server:power / network / resize / snapshot / terminate server:view
server:ssh-key / wireguard server:view
server:console server:view
service:manage service:view
support:manage support:view

The role builder can let a user tick server:create without server:view and cluster:view. A grant made directly through the API cannot bypass the closure either.

Scoped grants

A role grant can apply to one server or site instead of the whole team. A scoped grant carries only these capabilities, on that server: server:view, server:power, server:network, server:resize, server:snapshot, server:terminate, and server:console. Every other capability is team-wide and comes only from a team-wide grant. For example, Developer on one server can stop that server, but cannot create a server or change the Team SSH keys. See IAM resource scope.

The 5 system roles

System roles are seeded from fixtures/team_role.json and are identical across all teams. Teams may also define custom roles scoped to themselves.

Capability Owner Admin Developer Viewer Billing
team:edit ✓ ✓
team:manage_members ✓ ✓
team:delete ✓
billing:view ✓ ✓ ✓
billing:manage ✓ ✓ ✓
cluster:view ✓ ✓ ✓ ✓ ✓
server:view ✓ ✓ ✓ ✓ ✓
server:create ✓ ✓ ✓
server:power ✓ ✓ ✓
server:network ✓ ✓ ✓
server:resize ✓ ✓ ✓
server:snapshot ✓ ✓ ✓
server:ssh-key ✓ ✓ ✓
server:wireguard ✓ ✓ ✓
server:terminate ✓ ✓ ✓
server:console ✓ ✓ ✓
service:view ✓ ✓ ✓ ✓ ✓
service:manage ✓ ✓ ✓ ✓
support:view ✓ ✓ ✓ ✓ ✓
support:manage ✓ ✓ ✓ ✓
app:deploy ✓ ✓ ✓
app:view ✓ ✓ ✓ ✓

Totals: Owner 22, Admin 21, Developer 17, Viewer 5, Billing 8.

The ladder reads top to bottom: Viewer (look), Billing (look and pay), Developer (operate servers), Admin (Developer and run the team), Owner (Admin and delete the team). A team has exactly one Owner, transferable through Transfer Ownership. For a different mix, such as server operations without billing, create a custom role.

Changing the taxonomy

Stored grants, fixtures, and the dashboard depend on the vocabulary. Adding, removing, or renaming a capability is a coordinated change:

  1. Edit the fixtures (fixtures/capability.json, fixtures/team_role.json) and run bench export-fixtures --app central to regenerate them from the DB.
  2. Bump CAPABILITY_VERSION in central/iam.py to record the taxonomy revision.
  3. Add a migration patch to delete removed records. Fixture sync only upserts. It never deletes.
  4. Update this document.

Never rename a capability in place. Stored grants and every consumer keep the old string, and the result authorizes the wrong thing without an error. Add the new capability, migrate grants to it, then retire the old one.

Rescue boot selection requires both server:power and server:console on the selected server. Reading rescue state requires server:view. The existing free-trial server-access restriction applies to changing the selection; System Manager retains its operator bypass.