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
| Role | Rank | Permissions |
|---|---|---|
owner | 2 | read, plan, configure, secrets, runners, trusts, administer |
admin | 1 | read, plan, configure, secrets, runners, trusts, administer |
member | 0 | read, 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
| Permission | Allows | Granted to |
|---|---|---|
read | See a workspace and its resources, and export it as Terraform. | Every role. Every token. |
plan | Check 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. |
configure | Create, change and delete teams, lines, integrations, hooks, skills and harness profiles; change the workspace. | Owners, admins. Tokens with configure. |
secrets | Create, change and delete secrets, and set the value of a secret that Terraform does not set. | Owners, admins. Tokens with secrets. |
runners | Create, change and delete runner pools, egresses, runner trusts and workspace runners. | Owners, admins. Tokens with runners. |
trusts | Create, change and delete OIDC trusts. | Owners, admins. Tokens with trusts. |
administer | Issue, 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-workspaces | Create 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 missing | Title |
|---|---|
configure, secrets, runners, trusts | Not allowed to change the <kind> |
administer | Not allowed to administer the <kind> |
create-workspaces | Not allowed to create a workspace |
plan | Not 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.
| Scope | Also grants | Permissions |
|---|---|---|
read | read | |
plan | read | read, plan |
configure | plan, read | read, plan, configure |
secrets | read | read, secrets |
runners | read | read, runners |
trusts | read | read, 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.
| Level | Who | Allows |
|---|---|---|
| Acts on the team | People 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 team | People 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
readscope.
Anyone else is answered 404, as for something that does not exist.
| Outcome | Where |
|---|---|
| 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 items | Inbox items saying that an alert of a station fired. They reach no one else. |
| Insights | Every tab of a team's Insights page, the Insights API, and the Replayed candidates API. |
| Replay checks | A 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 outcomes | The 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 notices | Inbox 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
ownerrole. - 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:
| Status | Message | Cause |
|---|---|---|
403 | This person is not a member of this workspace. | The person is not a member of the workspace. |
403 | Only an owner or an admin can set roles. | The caller is not an owner or admin. |
403 | You can only set roles for people below you. | An admin changing an owner or another admin. |
403 | You cannot change your own role. | An admin changing their own role. |
403 | You cannot assign a role above your own. | An admin assigns the owner role. |
409 | The 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.
| Action | Endpoint | Who may |
|---|---|---|
| Invite | POST /api/workspaces/{slug}/invites | Owners and admins. |
| List pending invites | GET /api/workspaces/{slug}/invites | Owners and admins. |
| Resend an invite | POST /api/workspaces/{slug}/invites/{inviteId}/resend | Owners and admins. |
| Revoke an invite | DELETE /api/workspaces/{slug}/invites/{inviteId} | Owners and admins. |
| Read the preview of an invite | GET /api/invites/{token} | Anyone with the link, signed in or not. |
| Accept an invite | POST /api/invites/{token}/accept | The person signed in with the invited address. |
| Add a member to a team | POST /api/teams/{teamId}/members | Owners 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
adminormemberrole. Nobody is invited as anowner; owners and admins may both invite asadmin. - 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:
| Outcome | Web app | Meaning |
|---|---|---|
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.
| State | Meaning |
|---|---|
pending | Sent, not yet accepted, revoked or expired. |
accepted | Accepted. |
revoked | Taken back. |
expired | Not 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:
| Action | Needs |
|---|---|
Anything under administer | An owner or admin. |
| Creating a workspace | Any signed-in person. |
| Setting up configuration as code: starting a setup chat | An 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 permission | The 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:
| Condition | Checked 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. |
| Status | Message | Cause |
|---|---|---|
403 | Only a workspace owner or admin can connect GitHub. | Not an owner or admin. |
403 | You are not an admin of this GitHub installation. | Not an admin of the installation. |
403 | GitHub could not confirm this installation is yours. Please sign in again. | GitHub would not say. |
409 | GitHub 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.
| Action | Who may |
|---|---|
| Connect or reconnect the team | An owner or admin of the workspace. |
| Connect, reconnect or disconnect their own account | Any person on the team, for an integration whose actsAs is requester. |
| See who on the team has connected, with their linked accounts | An owner or admin of the workspace. Nobody sees another person's token. |
| Disconnect another person | Nobody. |
| Set what to ask of each tool's calls made with their own connection | Any 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 rule | Only 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.