Permissions: who can do what

The roles of an account, what each may do, how to ask before you try, and what happens when you may not.

Everything you do in an account is checked against your role in it. A role holds a set of named permissions; an operation needs one permission, and is refused when your role does not hold it. The refusal says which role you have and which permission was missing.

What each role may do

PermissionWhat it allowsownermaintainerdeveloperreporteroperator
agents.readread agents, drafts, versions and releasesyesyesyesyesyes
deployments.readread environments, rollouts and their historyyesyesyesyesyes
promotions.readread promotionsyesyesyesyesyes
agents.createcreate an agentyesyesyes
agents.updateedit a draft; build a preview version of ityesyesyes
versions.publishpublish a versionyesyesyes
agents.deployapply a rollout to dev or staging; ask for productionyesyesyes
evaluations.recordrecord the evidence a promotion relies onyesyesyes
promotions.requestask for a promotion, and withdraw your ownyesyesyes
promotions.reviewapprove or reject a promotionyesyes
deployments.managestop an environment serving an agentyesyes
environments.manageturn staging on or off; change who approves promotions into an environmentyesyes
audit.readread the audit trailyesyes

Three rules sit on top of the table:

  • Nobody may approve a promotion they requested themselves.
  • Production is only ever changed through an approved promotion.
  • An environment can be stricter than the role. Holding promotions.review is necessary, but the environment also names the roles whose members may decide, and how many approvals it needs (see below).

Who approves promotions into an environment

Each environment, stg and prod, carries a promotion policy. Production is gated by default; the others are not.

SettingMeaningDefault for prod
requireEvaluationa passing evaluation of the release in the previous environment is neededyes
requireApprovala promotion waits for people to approve ityes
approversthe roles whose members may approve or rejectowner, maintainer
minApprovalshow many different people must approve (1 to 5)1
progressDeadlinehow long a deployment may stay Degraded before it fails, for example 5m (0s fails at once, at most 24h). Within it a Degraded report is a condition, not an outcome, so one failed probe does not fail a production promotion for good5m

A person with environments.manage changes it with an Environment file:

apiVersion: robotelos.io/v1
kind: Environment
metadata:
  name: prod
spec:
  promotion:
    requireEvaluation: true
    requireApproval: true
    approvers: [owner, maintainer]
    minApprovals: 2

With two approvals, the first one is recorded and the promotion keeps waiting (awaiting_approval (1 of 2 approvals)); production changes only when a second, different person approves. One rejection ends a waiting promotion. If you change the policy while a promotion waits, it is decided under the new policy. Every change of policy is in the audit trail.

Ask before you try

robotelos can-i promotions.review          # yes, or: no: your role (developer) does not hold promotions.review
robotelos can-i                            # your role and everything it may do
robotelos can-i agents.deploy -o json

can-i exits with an error for “no”, so a pipeline can stop early:

robotelos can-i agents.deploy && robotelos apply -f rollout-dev.yaml

The same answer is available to the console and to your own tools as GET /api/v1/accounts/{account_id}/permissions.

Changing what a role may do

What a role may do is data, not code: it is the role_permissions table of the control plane’s database, and a change takes effect at once for everyone with that role. Today that table is changed by whoever operates the database. Letting an account owner grant permissions to roles in their own account, and naming the approvers of an environment, are designed but not built yet.

Next steps