Roles and permissions

A person's authority comes from their role in a workspace, in the web app and through a login from spotlight login. A workspace token's authority comes from its scopes. Teams have no roles of their own. Who may work on a team's tasks, and who may answer its questions, is in Team access. Reading how a team's work turned out is in Team outcomes.

Roles

RoleRankPermissions
owner2read, plan, configure, secrets, runners, trusts, administer
admin1read, plan, configure, secrets, runners, trusts, administer
member0read, plan

The web app shows the roles as Owner, Admin and Member. The person who creates a workspace is its owner. A person who accepts an invite joins with the role the invite assigns, admin or member. A workspace always has at least one owner.

A deleted workspace grants nothing to anyone.

Permissions

PermissionAllowsGranted to
readSee a workspace and its resources, and export it as Terraform.Every role. Every token.
planCheck expressions, at POST /api/v1/expressions/check. Start replay checks, on a team whose outcomes the caller may read.Every person. Tokens with plan or configure.
configureCreate, change and delete teams, lines, integrations, hooks, skills and harness profiles; change the workspace.Owners, admins. Tokens with configure.
secretsCreate, change and delete secrets, and set the value of a secret that Terraform does not set.Owners, admins. Tokens with secrets.
runnersCreate, change and delete runner pools, egresses, runner trusts and workspace runners.Owners, admins. Tokens with runners.
trustsCreate, change and delete OIDC trusts.Owners, admins. Tokens with trusts.
administerIssue, change and revoke workspace tokens; read configuration changes; delete the workspace; invite people, list, resend and revoke invites, and add members to teams; connect GitHub; connect the team to an integration over OAuth.Owners, admins. Never a token.
create-workspacesCreate a workspace.Every signed-in person. Never a token.

A request for something the caller cannot see returns 404. A request to change something the caller can see but may not change returns 403:

Permission missingTitle
configure, secrets, runners, trustsNot allowed to change the <kind>
administerNot allowed to administer the <kind>
create-workspacesNot allowed to create a workspace
planNot allowed to plan

See Resource API for the error format.

Token scopes

A workspace token carries one or more scopes. Each scope grants itself and the scopes listed beside it.

ScopeAlso grantsPermissions
readread
planreadread, plan
configureplan, readread, plan, configure
secretsreadread, secrets
runnersreadread, runners
trustsreadread, trusts

A token's scopes must include read, plan or configure, and name each scope once; see Scopes for the messages. A token acts only in its own workspace. See spotlight_oidc_trust for tokens a trust issues.

Team access

A team gives two levels of access to its tasks.

LevelWhoAllows
Acts on the teamPeople on the team, the workspace's owners and admins, and workspace tokens of the workspace.Send messages to the team's runs and stop them, move tasks, assign them to people on the team, and drive or resume a task on hold. A message that puts a task on hold assigns it to the sender, so only people on the team can send one.
On the teamPeople on the team.Be assigned a task. Answer or resolve a question on a task with no assignee, get it in their inbox, and see it wait for them.

The first answer to a question on a task with no assignee assigns the task, so an owner or admin of the workspace who is not on the team cannot answer it, and is answered 403. See Questions for the team.

Team outcomes

How a team's work turned out can be read only by:

  • people on the team;
  • the workspace's owners and admins;
  • workspace tokens of the workspace with the read scope.

Anyone else is answered 404, as for something that does not exist.

OutcomeWhere
Station outcomes"Latest runs on this config" and "Recent runs" on a work station's Activity tab, and "Live config" on its Config tab. See Station outcomes.
Station alert itemsInbox items saying that an alert of a station fired. They reach no one else.
InsightsEvery tab of a team's Insights page, the Insights API, and the Replayed candidates API.
Replay checksA work station's replay checks, through the Replay checks API. Starting a check also needs plan. Replays, searches and their runs do not show in the app.
Config change outcomesThe outcome verdict of each station config change, under Impact on the Insights Stations tab and through the Insights API, and the notice when a change made a station worse. The notice reaches every member of the team.
Search noticesInbox notices about a station's searches: a config pull request opened or failed, a stalled search's causes, and a skip a person must fix. They reach every member of the team. See Notices.

Members

GET /api/workspaces/{slug}/members lists everyone in the workspace, with their role, their teams and the roles the caller may assign to them. Every member of the workspace may read it. The web app's Members page (see Web app) is shown only to owners and admins; a member who opens it is sent to the workspace's own route.

GET /api/workspaces/{slug}/oidc-trusts lists the workspace's OIDC trusts, with who created each one and when it last issued a token. Only owners and admins may read it. Anyone else gets 404, and a workspace token gets 401. The web app shows it on the API access page.

Changing roles

Roles are changed on the Members page, in the "Members" list of any team's "General" settings page, or with PATCH /api/workspaces/{slug}/members/{userId}. The role changed is the person's role in the workspace, and applies in every team.

  • Only an owner or an admin may set roles.
  • An owner may change anyone's role, including their own.
  • An admin may change only members, and may not assign the owner role.
  • The last owner may not be assigned another role.

For an owner or admin, setting a person's role to the one they already have changes nothing and is not denied. A denied change returns one of these:

StatusMessageCause
403This person is not a member of this workspace.The person is not a member of the workspace.
403Only an owner or an admin can set roles.The caller is not an owner or admin.
403You can only set roles for people below you.An admin changing an owner or another admin.
403You cannot change your own role.An admin changing their own role.
403You cannot assign a role above your own.An admin assigns the owner role.
409The workspace needs at least one owner. Please make someone else an owner first.The last owner is assigned another role.

The web app offers a role menu only where more than one role can be assigned.

Invites

An invite asks one email address to join the workspace with a role, and optionally names teams of the workspace to join.

ActionEndpointWho may
InvitePOST /api/workspaces/{slug}/invitesOwners and admins.
List pending invitesGET /api/workspaces/{slug}/invitesOwners and admins.
Resend an invitePOST /api/workspaces/{slug}/invites/{inviteId}/resendOwners and admins.
Revoke an inviteDELETE /api/workspaces/{slug}/invites/{inviteId}Owners and admins.
Read the preview of an inviteGET /api/invites/{token}Anyone with the link, signed in or not.
Accept an invitePOST /api/invites/{token}/acceptThe person signed in with the invited address.
Add a member to a teamPOST /api/teams/{teamId}/membersOwners and admins.

Every action but reading an invite link needs a person signed in; a workspace token is answered 401. A caller who is not an owner or admin of the workspace is answered 404 by the actions only they may take, as for a workspace that does not exist.

  • An invite assigns the admin or member role. Nobody is invited as an owner; owners and admins may both invite as admin.
  • One request invites 1 to 50 addresses, all with the same role and teams. Addresses are compared without regard to case, and a repeated address is invited once.
  • An address that belongs to a member of the workspace is sent nothing.
  • Spotlight resends the invite of an address that has a pending or expired invite, with a new link, the role and teams of this request, and a fresh 14 days. An address whose invite was revoked or accepted gets a new invite.
  • Resending an invite replaces its link; the old link stops working. Only a pending or expired invite can be resent.
  • Revoking an invite stops its link working. Revoking a revoked invite changes nothing. An accepted invite cannot be revoked.
  • An invite lasts 14 days from when it was last sent.
  • Accepting needs the person to be signed in with the invited address, compared without regard to case, and the invite to be pending.
  • Accepting adds the person to the workspace with the invite's role, and to each team it names that still belongs to the workspace. A person already in the workspace keeps their role and is added to the teams.
  • The pending invites list contains only pending invites, newest first.
  • Adding a member to a team needs the person to be in the workspace already.

Each address in an invite request gets one outcome:

OutcomeWeb appMeaning
invited"Invited"A new invite was emailed.
resent"Resent"A pending or expired invite was emailed again.
already-a-member"Already a member"The address belongs to a member. Nothing was sent.
not-sent"Not sent. Please resend it from Pending invites."The invite was written but the email could not be sent.

The email's subject reads <inviter> invited you to join <workspace> on Spotlight, names the teams the invite joins, and links to /invites/<token> at the Spotlight address. When the control plane has no mail server set (SMTP_URL), the message is written to its log instead of sent.

StateMeaning
pendingSent, not yet accepted, revoked or expired.
acceptedAccepted.
revokedTaken back.
expiredNot accepted within 14 days of being last sent.

Errors and messages lists the errors. See Invite people and change their roles and Join a workspace from an invitation.

Actions only people can take

These need a person signed in to Spotlight. A workspace token cannot do them:

ActionNeeds
Anything under administerAn owner or admin.
Creating a workspaceAny signed-in person.
Setting up configuration as code: starting a setup chatAn owner or admin. The setup creates OIDC trusts. Anyone else is answered 403 with Only a workspace owner or admin can set up configuration as code. The setup creates the OIDC trusts that GitHub Actions signs in with.
Approving, editing or dismissing a tool call or harness permissionThe assignee of the task that asks, or a member of its team when the task has no assignee. A call that asks because of a person's own tool rule is put to that person, and only they can approve it.

Answering the inbox is also reserved to the task's assignee, or to a member of the task's team when the task has no assignee (see Questions for the team). Sending a message to a run and stopping a run need a person who acts on the team.

Opening a task's working copy in an editor needs a person who is a member of the workspace that has the task; a chat's working copy, the person who started the chat. A workspace token cannot do it. See Editor connections.

GitHub connection

Connecting a GitHub App installation to a workspace needs both:

ConditionChecked by
The person is an owner or admin of the workspace.Their workspace role.
The person is an admin of the installation.GitHub, with the person's GitHub sign-in. For an organisation's installation, they are an active admin of the organisation. For a user's installation, they are that user.
StatusMessageCause
403Only a workspace owner or admin can connect GitHub.Not an owner or admin.
403You are not an admin of this GitHub installation.Not an admin of the installation.
403GitHub could not confirm this installation is yours. Please sign in again.GitHub would not say.
409GitHub installation <id> is connected to another workspace. Please disconnect it there first.Connected to another workspace.

One installation connects one workspace. See Installation callback and Connect GitHub to a workspace.

Integration connections

An integration that connects over OAuth has a team connection, and, when its connection.actsAs is requester, a connection for each person who makes one. See Acts as.

ActionWho may
Connect or reconnect the teamAn owner or admin of the workspace.
Connect, reconnect or disconnect their own accountAny person on the team, for an integration whose actsAs is requester.
See who on the team has connected, with their linked accountsAn owner or admin of the workspace. Nobody sees another person's token.
Disconnect another personNobody.
Set what to ask of each tool's calls made with their own connectionAny person on the team, for themselves only, for an integration whose actsAs is requester.
Approve a call that asks because of a person's own ruleOnly that person. The task is put to them. Whoever may answer the task can dismiss the call.

A tool of a requester integration acts only with the connection of the person who started the task, and only while they are on the team. Of the team's rule for a tool and that person's, the stricter wins. See Person rules and Connect an integration that signs in with OAuth.

On this page