Skip to content

feat(workspaces): admins see every workspace, open one only by joining (D6) - #495

Merged
huyplb merged 1 commit into
mainfrom
feat/workspaces-admin
Oct 10, 2026
Merged

huyplb merged 1 commit into
mainfrom
feat/workspaces-admin

Conversation

@huyplb

@huyplb huyplb commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

D6 of the workspaces plan. Stacked on #494 (D4) → #493 → #492 → #491.

What changes

  • GET /api/workspaces/all (admins only): every workspace, private ones included: name, visibility, owners, member count, personal owner, archived, and whether the asking admin is in it. Never its connections, history or secrets. Contract table 133 → 134.
  • Admin → Access control → Workspaces tab: Join (confirm says its members will see it; the admin appears in the member list as added by itself), Open once in it, Members (the settings dialog: change roles, hand ownership on, remove), Archive for shared workspaces, Show archived.
  • Unchanged and now tested: an admin, like everyone, can act only in a workspace it is a member of; X-Fox-Workspace/select for a workspace it is not in answers 404.
  • Deviation from the plan: there is no separate narrowing of the admin permission bypass. Membership is already required to act in a workspace, and inside one an admin keeps every permission.

Tests

  • Directory tests (+5): the admin sees every workspace with owners and size but no data, the list is admin-only, the admin can't act in a workspace before joining, joining shows to members with added-by, transfer ownership + archive + show archived. A/B: dropping the admin-only check fails.
  • AdminWorkspacesPanel.test.tsx (5): list text, Join only (no Open) before joining with the "members will see you" confirm, Open switches, archive shared only, show archived. A/B: offering Open without joining fails.
  • e2e workspaces.test.ts 7/7 against the dev server: the admin finds a throwaway account's personal workspace in the tab with Join and no Open, joins, and the account sees the admin in its member list; the admin then leaves.
  • Full suite 6028 passed.

Review

Fixed: a cross-feature import of the workspaces API's internals (architecture test). Left: deactivated accounts' workspaces aren't marked in the list; Join always makes the admin an owner.

🤖 Generated with Claude Code


Note

Medium Risk
Expands admin visibility across all workspaces and adds join-as-owner flows that affect member lists; membership gates still block silent data access, but mis-clicks or policy gaps around admin addMember could have broader impact than normal user actions.

Overview
Adds admin-wide workspace directory (D6): admins can see every workspace on the install (including private and personal) with metadata only—names, owners, member counts, archived state—not connections or secrets.

Backend: New GET /api/workspaces/all (?archived=1 optional) and listAll on the workspace directory, restricted to app admins. Acting in a workspace still requires membership; select/access for non-member workspaces stays 404.

Admin UI: New Workspaces tab under Access control lists all workspaces with Join (confirm warns members will see the admin), Open after joining, Members (reuses workspace settings, with optional knownName when the admin isn’t in their workspace list), Archive for shared workspaces, and Show archived.

Tests: Directory unit tests, AdminWorkspacesPanel component tests, e2e coverage for admin join visibility, and HTTP contract bump (133 → 134 routes).

Reviewed by Cursor Bugbot for commit 922cc7d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: be5beecc-3caa-47ca-9406-7445b20867c4)

@github-actions

Copy link
Copy Markdown
Contributor

Test IDs

Added (10)

  • admin-tab-workspaces
  • admin-workspace-archive-{…}
  • admin-workspace-join-{…}
  • admin-workspace-members-{…}
  • admin-workspace-open-{…}
  • admin-workspace-{…}
  • admin-workspaces
  • admin-workspaces-error
  • admin-workspaces-list
  • admin-workspaces-show-archived

{…} is a part filled in at run time. The full tree: docs/testing/TEST_IDS.md.

@huyplb
huyplb force-pushed the feat/workspace-invites branch from 8497bc3 to cd337da Compare October 10, 2026 04:32
Base automatically changed from feat/workspace-invites to main October 10, 2026 04:36
…ning it

D6 of the workspaces plan.

- GET /api/workspaces/all (admins): every workspace, private ones
  included, with owners and size — never what it holds.
- Admin → Access control → Workspaces: Join (the admin appears in the
  member list, added by itself), Open once in it, Members (hand
  ownership on), Archive shared workspaces, show archived.
- Nothing changes for acting in a workspace: admins, like everyone,
  must be members of the workspace a request acts in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@huyplb
huyplb force-pushed the feat/workspaces-admin branch from 64361a5 to 922cc7d Compare October 10, 2026 04:36
@cursor

cursor Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 9373b424-4a29-452e-b197-78de4fd4d84b)

@huyplb
huyplb merged commit 6d6c438 into main Oct 10, 2026
13 checks passed
@huyplb
huyplb deleted the feat/workspaces-admin branch October 10, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant