Skip to content

Roles and permissions

In password mode every request from a personal account is checked against roles. A role is a named list of operations; users get one or more roles; an operation can be limited to specific resources. The built-in admin account bypasses all checks.

Manage roles in Administration → Security → Roles & permissions. Only admin can open it.

The model

operation  = HTTP method + API route        e.g.  POST /api/templates/{template_id}/launch
role       = name + list of operations      e.g.  "Stage operators"
scope      = for one role and one operation with an {id}: the list of allowed IDs
binding    = user → list of roles

A request is allowed when any of the user's roles contains the operation and, if that role scopes the operation, the request's first ID in the path is in the scope. An empty scope means every object. Permissions from several roles add up.

The editor lists every assignable operation. They correspond one-to-one to API routes, so the API reference is also the permission reference.

What only admin can do

These are never assignable to a role:

  • everything under /api/admin/ — settings, Vault configuration, schedules and retention, roles, SSO bindings, registration, topology, assistant configuration;
  • managing users (/api/users);
  • /api/auth/ routes other than a user's own session.

Every signed-in user may always read their own session, change their own password and sign out.

Typical roles

Role Operations
Viewer GET /api/dashboard, GET /api/system, GET /api/runs, GET /api/runs/{run_id}, GET /api/jobs, GET /api/jobs/{job_id}, GET /api/workflows, GET /api/templates
Log reader Viewer + GET /api/runs/{run_id}/nodes/{node_id}/logs, GET /api/runs/{run_id}/nodes/{node_id}/info, GET /api/runs/{run_id}/nodes/{node_id}/terraform
Operator (stage) Log reader + POST /api/templates/{template_id}/launch and POST /api/workflows/{workflow_id}/runs, scoped to stage templates and workflows, + POST /api/runs/{run_id}/cancel
Approver Log reader + POST /api/runs/{run_id}/nodes/{node_id}/approval
Author Create and update projects, inventories, templates, workflows, credentials; sync projects and inventories; no launch
Assistant user GET /api/assistant, POST /api/assistant/chat

Keeping Author and Operator apart, and Approver apart from both, gives a basic separation of duties: those who change code cannot run it with production credentials, and those who launch a Terraform plan cannot approve it.

Scopes

Only operations with an ID in the path can be scoped. The scope applies to the first ID in the path:

Operation Scoped by
POST /api/templates/{template_id}/launch template ID
POST /api/workflows/{workflow_id}/runs workflow ID
PUT /api/templates/{resource_id} template ID
POST /api/projects/{project_id}/sync project ID
GET /api/hosts/{inventory_id} inventory ID
… /api/runs/{run_id}/nodes/{node_id}/… run ID — the parent run, not the step

Because run operations are scoped by run ID, scoping logs or approvals to "runs of workflow X" is not possible: you would have to list individual runs. Scope the launch operations instead, and grant run-level reading broadly or not at all.

What a permission really allows

  • Listing exposes the whole list. GET /api/templates returns every template with all fields the API returns, including scripts and extra variables. Scopes do not filter lists.
  • Dashboard and hosts are aggregates. GET /api/dashboard and GET /api/hosts show counts and catalogues across all inventories and runs.
  • Launching uses the automation's credentials. A user allowed to launch a template runs it with the credentials and execution environment saved on it, without seeing their values.
  • Edit + launch = arbitrary code. Someone who can both change a template, workflow, project or inventory and launch it can make it do anything its credentials allow. Separate these roles where it matters.
  • Roles are not tenant isolation. All users see the same lists and share the same runner identity and Vault reader role.

Concurrent edits

The editor loads the policy with a version. If someone else saved in the meantime, saving fails with Permissions changed. Reopen the editor to review the latest roles. (412). Reopen, review and save again.

Rolling out roles

  1. Keep an admin session open while you work.
  2. Create personal accounts and roles; bind the roles.
  3. Ask users to sign in again and try one allowed and one forbidden action — a forbidden action returns Permission denied (403).
  4. Only then announce the installation more widely.

Existing users keep working while you add roles, because changing roles does not end sessions; deactivating a user does.

Through the API

GET /api/admin/rbac returns roles, bindings, scopes, the list of permissions and a version. PUT /api/admin/rbac with header If-Match: <version> replaces the whole policy:

{
  "roles": {
    "Stage operators": [
      "GET /api/runs", "GET /api/runs/{run_id}",
      "GET /api/runs/{run_id}/nodes/{node_id}/logs",
      "POST /api/templates/{template_id}/launch"
    ]
  },
  "scopes": {
    "Stage operators": {
      "POST /api/templates/{template_id}/launch": ["6f1c…", "a93e…"]
    }
  },
  "bindings": {
    "<user-id>": ["Stage operators"]
  }
}

Unknown operations, unknown users, unknown roles in bindings and scopes on operations without an ID are rejected with 422.