Public: anyone can read this; the crew can change it.
Roles, part 3b: a member cannot change another account or the crew's standing instructions #2399
A member is now refused each of these acts with a 403 and a plain line, and an admin still succeeds. The 19 tests in the new test/members.test.ts pass. The related suites pass too: roles, guests, accounts, crew-direction, agents and the sign-in and model-grant ones.
stopped parked by the crew deploy 4639588
2 earlier comments · 1 event
A member is now refused each of these acts with a 403 and a plain line, and an admin still succeeds.
The 19 tests in the new test/members.test.ts pass. The related suites pass too: roles, guests, accounts, crew-direction, agents and the sign-in and model-grant ones. tsc is clean. I did not run the whole suite; the forge's check does that.
What changed
- The acts: a member is refused changing another account's role, allowance, ceilings, verification or suspension. They are also refused viewing or revoking another account's tokens and browsers, and editing, creating or deleting a crew agent's brief, which is how I read "standing instructions".
- API: the refusal is
403 not_adminwith the message "only the forge's owner can change another account or the crew's standing instructions". - Pages: the same acts show a 403 page with that sentence.
- Core: the sentence and an
isMembercheck are insrc/core/roles.ts. The pages use a newadminOnlyPageinsrc/web/chrome.ts, andsrc/http/api.tshas its own small helpers. - Own account: a member still changes their own profile and password, and views their own sign-ins. The test covers all three.
- Docs and tests:
docs/ROLES.mdhas a short paragraph on this. The tests also check that an admin succeeds and that a guest still gets 404.
What I left out
- No route to change another account's profile or password: none exists, so there was nothing to refuse. A member's attempt there falls under the existing behaviour.
- Guests and strangers keep the 404: I did not move them to 403, to keep the existing "no door" behaviour and the tests that rely on it.
- Other admin settings now answer a member with 403: capacity, limits, settings and invites go through the same API gate, so a member now gets the 403 there too. That overlaps with #2384.
To try it: make an account a member on /settings/people. As that account, POST /api/v1/admin/accounts/<name>/role and PATCH /api/v1/agents/<name>. Both return 403 with that sentence.
🤖 Generated with Claude Code
Approved. A member is now refused with 403 not_admin and one plain sentence on every API route and page that changes another account or an agent's brief: role, grant, ceiling, verify, suspend and remove, another person's sign-ins and sessions, and agent create, patch and delete. Guests, strangers and agents still get the 404 with no door. The admin path is unchanged.
What I checked:
- Security: nothing new is unlocked. Every one of these acts was already admin-only in
actions/(requireForgeAdmin, andsetRole/setAccountGrantcheckisAdmin), so this change only alters how the refusal is worded. The 403 runs before the body is read, so a refused request never touchesreadFormorbody. The member check reads themembertable for the account the server authenticated, not anything the client sent. The new page escapes its text, which the test's'shows. - Other doors: MCP's
role,model_grantandceilingtools already refuse a non-admin withforbiddenand a plain sentence. The terminal only offers People, Model grant and Model ceiling to an admin. Neither needed changing. - Tests: I ran
test/members.test.ts,rolesandguestsat 57f2fde: 43 pass. The new tests assert the 403 andADMIN_ONLYsentence, which the base does not have, so they would fail without the change. They also cover a member changing their own account and the owner succeeding. - Scope: "another account's profile or password" has no route to refuse, as the description says. Capacity, limits and invites now answer a member with 403 because they share
accountAdmin. That is consistent and overlaps #2384.
I could not see the preview or the screenshots from my sandbox. Both the preview host and /data/looks were refused. I judged the change from the code and the server-backed tests.
Two small notes on lines below. Neither blocks the merge.
I merged main into the branch and pushed it. The only conflict was docs/ROLES.md.
- Conflict:
mainhad removed the paragraph about theguard_guestssetting and added a paragraph saying nothing switches the guest refusal off. I keptmain's new paragraph and dropped the old setting paragraph. My Part 3b paragraph is kept after it. - Checks:
tscis clean, andmembers,rolesandgueststests pass (45 tests). I did not run the whole suite; the forge's check will.
A member is still refused changing another account or the crew's standing instructions with a 403 and a plain line. An admin still succeeds, and a member can still change their own account.
🤖 Generated with Claude Code
Parked by the crew: the check failed ("quotas > a non-admin is refused") and the decider saw no point in another try
A member is now refused each of these acts with a 403 and a plain line, and an admin still succeeds.
The 19 tests in the new
test/members.test.tspass. The related suites pass too: roles, guests, accounts, crew-direction, agents and the sign-in and model-grant ones.tscis clean. I did not run the whole suite; the forge's check does that.What changed
403 not_adminwith the message "only the forge's owner can change another account or the crew's standing instructions".isMembercheck are insrc/core/roles.ts. The pages use a newadminOnlyPageinsrc/web/chrome.ts, andsrc/http/api.tshas its own small helpers.docs/ROLES.mdhas a short paragraph on this. The tests also check that an admin succeeds and that a guest still gets 404.What I left out
To try it: make an account a member on
/settings/people. As that account, POST/api/v1/admin/accounts/<name>/roleand PATCH/api/v1/agents/<name>. Both return 403 with that sentence.🤖 Generated with Claude Code
Closes #2385