Skip to content

ref(auth): Rename dashboard:write scope to dashboard:update - #128801

Merged
DominikB2014 merged 1 commit into
masterfrom
dominikbuszowiecki/eng-8891-rename-dashboardwrite-scope-to-dashboardupdate
Oct 26, 2026
Merged

DominikB2014 merged 1 commit into
masterfrom
dominikbuszowiecki/eng-8891-rename-dashboardwrite-scope-to-dashboardupdate

Conversation

@DominikB2014

@DominikB2014 DominikB2014 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Renames dashboard:write to dashboard:update. write isn't as accurate, and confusing if we also have create/delete. write should instead be used to wrap create/update/delete

Refs ENG-8891

Dashboards have a separate dashboard:create scope, so dashboard:write read as if it
included create. Rename it to dashboard:update so the dashboard scopes map to CRUD:
read, create, update and delete. dashboard:write is removed rather than kept as an
alias.

The scopes are still in GRANULAR_SCOPES and only granted to roles behind
organizations:granular-permission-scopes, so few stored tokens hold dashboard:write.
Those tokens lose dashboard update access unless they also hold org:read, which the
dashboard endpoints still accept.

Refs ENG-8891
@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown

ENG-8891

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 26, 2026
@DominikB2014
DominikB2014 marked this pull request as ready for review October 26, 2026 18:43
@DominikB2014
DominikB2014 requested review from a team as code owners October 26, 2026 18:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d0a00bd. Configure here.

scope_map = {
**OrganizationDashboardsPermission.scope_map,
"POST": ["org:read", "org:write", "org:admin", "dashboard:create", "dashboard:write"],
"POST": ["org:read", "org:write", "org:admin", "dashboard:create"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update scope cannot create dashboards

Medium Severity

OrganizationDashboardsCreatePermission POST now accepts only dashboard:create and no longer accepts the renamed dashboard:update. Scope checks do not expand the hierarchy at request time, and token creation stores requested scopes as-is, so a token that holds dashboard:update without dashboard:create is denied on create even though update is documented to imply create.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d0a00bd. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, we never released granular scopes, it would only break me, because i created a token with dashboards:write, but that's okay

@sentry

sentry Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
- - - - - - ✅ 760 uploaded

Base commit ac8b097cad6a7441f41b6695c8325f20801fc27e did not produce snapshots to compare against. Did its snapshot job fail? Try rebasing this branch on a commit with a successful snapshot job.

⚙️ sentry-frontend Snapshot Settings

@DominikB2014
DominikB2014 merged commit ec8c704 into master Oct 26, 2026
91 of 92 checks passed
@DominikB2014
DominikB2014 deleted the dominikbuszowiecki/eng-8891-rename-dashboardwrite-scope-to-dashboardupdate branch October 26, 2026 19:26
sentry-junior Bot added a commit that referenced this pull request Oct 27, 2026
dashboard:write was renamed to dashboard:update on master (#128801).
Update the org:read translation and tests to match.

Refs ENG-8841

Co-Authored-By: Dominik Buszowiecki <[email protected]>
DominikB2014 added a commit that referenced this pull request Oct 28, 2026
We're starting dashboards with read/write scopes instead of full CRUD,
and can make them more granular later. This replaces `dashboard:create`,
`dashboard:update` and `dashboard:delete` with `dashboard:write`:
- `dashboard:read` lists and views dashboards.
- `dashboard:write` creates, updates and deletes dashboards, and implies
`dashboard:read`.

**Changes**
- `SENTRY_SCOPES`, `GRANULAR_SCOPES`, the scope hierarchy, scope sets,
`ApiScopes` and the granular roles in `conf/server.py` now list
`dashboard:read` and `dashboard:write`.
- The `org:read` translation adds `dashboard:read` and
`dashboard:write`.
- The OAuth consent screen shows Dashboards with Read and Write.
- Dashboard endpoints accept `dashboard:write` for POST, PUT and DELETE,
and the starred endpoint accepts it for PUT.
`OrganizationDashboardsCreatePermission` only existed to accept
`dashboard:create`, so it's removed.

**Rollout**
- Getsentry's granular roles and the granular token UI already use
`dashboard:write`. Neither was updated for the `dashboard:update` rename
(#128801), so this restores update access for members of flagged orgs
and makes the token UI's Write level work again.
- Follow-ups: a getsentry PR removes `dashboard:create` and
`dashboard:delete` from its granular roles, and a frontend PR offers
only Read and Write. Neither is needed for this PR to work.
- Stored tokens holding `dashboard:create`, `dashboard:update` or
`dashboard:delete` lose dashboard access. The granular scope flags are
only enabled for test orgs and users, so these are test tokens.

Refs ENG-8922
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants