fix(site): backport admin settings dropdown visibility fix to release/2.35 - #27850
Merged
Conversation
Backport of #27481 to release/2.35. Only the core fix (removing viewAnyMembers from canViewAnyOrganization, which incorrectly showed Organizations to every user due to workspace sharing) and the e2e regression test are backported. The upstream component refactor (shared AdminSettings.tsx, permissions object props) does not apply here: this branch's DeploymentDropdown/MobileMenu already gate the Admin settings menu with equivalent per-permission checks, so that refactor is unrelated to the bug fix. (cherry picked from commit b8727d9)
matifali
requested review from
aslilac and
nickvigilante
and removed request for
nickvigilante
August 5, 2026 11:43
…ViewOrganizations The backport of #27481 removed viewAnyMembers from canViewAnyOrganization and updated the e2e assertions, but this branch still renders the Organizations admin-settings item unconditionally (it predates the #27209 refactor that #27481 builds on). As a result admin/auditor/owner roles still saw Organizations and the roles.spec.ts assertions failed in CI. Gate the item behind canViewOrganizations in both the desktop DeploymentDropdown and the mobile MobileMenu, matching #27481's AdminSettings.tsx behavior. Generated with the help of Coder Agents.
jeremyruppel
approved these changes
Aug 5, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of #27481 to
release/2.35.closes #26695
Problem
canViewAnyOrganizationincludedviewAnyMembers, a permission every user now has because of workspace sharing. This meant the Admin settings dropdown (and the Organizations entry within it) showed up for every user, not just admins.Fix
permissions.viewAnyMembersfromcanViewAnyOrganizationinsite/src/modules/permissions/index.ts.site/e2e/tests/roles.spec.tsto match, including a new regression test for org members with no roles.Note on scope
Upstream #27481 also refactored
DeploymentDropdown/MobileMenuinto a sharedAdminSettings.tsxcomponent driven by a single permissions object. That refactor doesn't apply torelease/2.35: this branch'sDeploymentDropdownandMobileMenualready gate the Admin settings menu with equivalent per-permission checks, so only the actual permission fix and its test coverage are backported here.Validation
pnpm exec biome checkon the two changed files: clean.tscerrors in this branch are unrelated environment/dependency issues (reproduced identically on a cleanrelease/2.35checkout).