{{ message }}
Commit 350070e
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>1 parent b080be4 commit 350070e
4 files changed
Lines changed: 36 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
| |||

0 commit comments