fix(members): Enforce allowed org roles on member detail page#115840
Draft
JonasBa wants to merge 1 commit into
Draft
fix(members): Enforce allowed org roles on member detail page#115840JonasBa wants to merge 1 commit into
JonasBa wants to merge 1 commit into
Conversation
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>
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.56% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enforce the
isAllowedcheck on the organization role selector in the member detail page.OrganizationRoleSelectwas rendered withenforceAllowed={false}, which meant theisAllowedflag 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
enforceAllowedtotruemakes 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