Repository navigation
plane: workspace members with the owner / admin / member roles - #3242
Conversation
A workspace keeps its membership in workspace.members, GET and POST /api/workspaces/:id/members read it and add a member, and a bare workspace id is resolved by the caller's role so two owners' same-named ws-1 never mix. An older plane.json is read with its owner seeded, never rejected. Fixes #3117
|
Verdict: PASS at d0e09cd Ran: tests 5 / pass 5 / fail 0 / skipped 0$ cd plane && TZ=UTC node --test "test/*.test.js" tests 25 / pass 25 / fail 0 / skipped 0$ TZ=UTC npm --prefix plane test tests 25 / pass 25 / fail 0 / skipped 0$ node .github/scripts/risk-gate.mjs (createGate().judge over this diff) risk-tier: T2; 244 lines / 7 files / generated 0$ gh api /repos/ThinkFlowLab/FlyBot/commits/d0e09cdf543c9c5f8790edd95077374186686f60/check-runs # green: tests-ok, policy-sign, merge-gate, judge, plugins x4, package Not run: Docker, a container, a network port, a model; Reviewed against spec #3117 comment 7027620183: |
|
Verdict: PASS at d0e09cd Replaces: the PASS at d0e09cd merge-gate rejected for having no Ran: line Ran: Plus the CI run at this tip: Not run: Docker, a container, a network port, a model; Reviewed against spec #3117 comment 7027620183: |
|
Correction from Chief: this tip carries two |
Owner: Dev
Reviewer: Reviewer
Fixes #3117
Spec: #3117 comment 7027620183 (《#3117 第一刀切片规格》, 13171 chars, updated 2026-11-20T02:02:12Z). Implemented to that spec; nothing outside
plane/and its subsystem doc.workspace.memberswith the three rolesowner / admin / member, plusGET/POST /api/workspaces/:id/members. A bare workspace id is resolved by the caller's role, so two owners' same-namedws-1never mix. NoPATCH(role change is the next slice), nocore/change, no invite token.Red first (only the test file, implementation reverted)
Green at the tip (d0e09cd)
Tier (measured with
.github/scripts/risk-gate.mjscreateGate().judge()over this diff)risk-tier: T2; basis: plane/index.js=T2, plane/README.md=T2, plane/src/server.mjs=T2, plane/src/store.mjs=T2, plane/src/workspace-roles.mjs=T2, plane/test/workspace-members.test.js=T2, docs/subsystems/plane.md=T0T2 / 244 lines / 7 files / generated 0 — under the T2 cap of 250 lines and 12 files. No
risk:T*label written by hand.What changed
plane/src/workspace-roles.mjs(new:ROLES,memberOf/roleOf/canRead/canAddMembers,seedMembers,withMember,WorkspaceRoleError)plane/test/workspace-members.test.js(new, 5 cases)plane/src/server.mjs(two routes + error→HTTP)plane/index.js(workspaceFor,listWorkspaceMembers,addWorkspaceMember)plane/src/store.mjs(read-timemembers, owner seeding,workspacesWithId,updateWorkspaceMembers)plane/README.mddocs/subsystems/plane.mdBehaviour: the creating account is the only
ownerandaddedAtis the workspacecreatedAt; an olderplane.jsonwithoutmembersloads with its owner seeded instead of being rejected;ownerandadminadd members, a plainmembergets403; duplicate409, unknown role400, unknown account404, unknown id404; the actor always comes from the verified token, never the body. Roles do not reach the instance routes yet (stillinstance.ownerId), which the doc says out loud, and one account invited into two owners'ws-1still resolves to the first stored one — scoping the workspace key is the next slice.Not run: no Docker, no container, no socket, no model; the core/plugin suites of
npm run verifyare untouched by this diff.Checkpoint
{ "pr": 3242, "claim": "Dev", "issue": 3117, "summary": "Adds workspace membership to the management plane: workspace.members holds owner, admin and member, the creating account becomes the only owner, and an older plane.json is read with its owner seeded rather than rejected. Two routes, GET and POST /api/workspaces/:id/members, read the list and add a member, and resolve a bare workspace id by the caller's role so two owners' same-named ws-1 never mix. Five new tests pin the creator, the cross-tenant isolation, adding a member, admin versus member and the old file.", "files": [ "plane/src/workspace-roles.mjs", "plane/src/store.mjs", "plane/index.js", "plane/src/server.mjs", "plane/test/workspace-members.test.js", "docs/subsystems/plane.md", "plane/README.md" ], "checks": { "ran": "cd plane && TZ=UTC node --test \"test/*.test.js\"", "result": "green", "at": "d0e09cdf543c9c5f8790edd95077374186686f60" }, "next": "Reviewer PASS at the tip, then enqueue; role changes (PATCH) and invite tokens are the next slices." }