Skip to content

fix(members): Enforce allowed org roles on member detail page#115840

Draft
JonasBa wants to merge 1 commit into
masterfrom
jb/sentry/admin-role-bug
Draft

fix(members): Enforce allowed org roles on member detail page#115840
JonasBa wants to merge 1 commit into
masterfrom
jb/sentry/admin-role-bug

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented May 19, 2026

Enforce the isAllowed check on the organization role selector in the member detail page.

OrganizationRoleSelect was rendered with enforceAllowed={false}, which meant the isAllowed flag on each role was ignored. Roles that the current user lacks permission to assign (because the role's scopes exceed the viewer's own scopes) appeared as selectable radio buttons, even though the backend would reject the change. For example, a Manager could see Admin/Owner as selectable options.

Setting enforceAllowed to true makes the UI correctly disable roles above the viewer's scope level, matching the existing behavior on the invite flow and the backend's permission enforcement.

Ref: https://docs.sentry.io/organization/membership/#organization-level-roles

OrganizationRoleSelect was rendered with enforceAllowed={false},
which bypassed the isAllowed check on each role. This meant roles
the current user lacks permission to assign (based on scope hierarchy)
appeared as selectable in the UI, even though the backend would reject
the change. Set enforceAllowed to true so the UI correctly disables
roles above the viewer's scope level.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.56%

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant