Skip to content

fix(site): backport admin settings dropdown visibility fix to release/2.35 - #27850

Merged
matifali merged 2 commits into
release/2.35from
backport-27481-release-2.35
Aug 5, 2026
Merged

fix(site): backport admin settings dropdown visibility fix to release/2.35#27850
matifali merged 2 commits into
release/2.35from
backport-27481-release-2.35

Conversation

@matifali

@matifali matifali commented Aug 4, 2026

Copy link
Copy Markdown
Member

Backport of #27481 to release/2.35.

closes #26695

Problem

canViewAnyOrganization included viewAnyMembers, 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

  • Removed permissions.viewAnyMembers from canViewAnyOrganization in site/src/modules/permissions/index.ts.
  • Updated site/e2e/tests/roles.spec.ts to match, including a new regression test for org members with no roles.

Note on scope

Upstream #27481 also refactored DeploymentDropdown/MobileMenu into a shared AdminSettings.tsx component driven by a single permissions object. That refactor doesn't apply to release/2.35: this branch's DeploymentDropdown and MobileMenu already 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 check on the two changed files: clean.
  • Confirmed pre-existing tsc errors in this branch are unrelated environment/dependency issues (reproduced identically on a clean release/2.35 checkout).

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

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
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.
@matifali
matifali merged commit fe656fc into release/2.35 Aug 5, 2026
25 of 26 checks passed
@matifali
matifali deleted the backport-27481-release-2.35 branch August 5, 2026 21:01
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants