You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(site): backport admin settings dropdown visibility fix to release/2.34 (#27851)
Backport of #27481 to `release/2.34`.
## 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.34`: 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.34` checkout).
> 🤖 This PR was created with the help of Coder Agents, and needs a human
review. 🧑💻
---------
Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
0 commit comments