ADMIN_CAN_EDIT has no effect in the web client (staff always read-only) #10
Labels
No labels
priority/high
priority/low
priority/medium
type/feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ben/career-values-cards#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: the server honours
ADMIN_CAN_EDIT, but the web client ignores it.What the code does today:
server/policy.jscanWriteSession()lets the owner and, whenADMIN_CAN_EDIT=true, a linked counsellor write to a client's session.GET /api/sessions/:idreports this asreadOnly(server/app.js).web/src/main.ts(readOnly = !!s.readOnly || (!ownSession && (staff || …))) forces every staff member who views someone else's session into read-only, whatever the server reports. So the owner and counsellors can never edit a client's board in the UI, and settingADMIN_CAN_EDIT=truehas no visible effect.Decision needed:
ADMIN_CAN_EDITfrom config and docs, or document that it only affects the API.readOnlyflag. Edits by staff would be audited content mutations. Work out how that should look on the dashboard and in review.Found while adding contextual help (#9). The help text currently says counsellors "may be read-only, depending on the practice's settings".
Decision (maintainer, 2026-10-15): read-only staff review. The web client keeps opening every staff view of another person's session read-only.
Still to do:
ADMIN_CAN_EDIT, or document it as API-only. Removing it touches:server/index.jsanddocker-compose.yml;server/policy.jscanWriteSession, the policy matrix inserver/test/policy-matrix.test.js, and the related help text;CLAUDE.md.Decision (maintainer, 2026-10-15): the owner loses API write access to client sessions too. Only the session's own user writes it, while it isn't archived. The owner's own sessions are unaffected.
ADMIN_CAN_EDITis removed; a leftover value is ignored, and direct (non-Compose) runs log a warning. Plan:docs/plans/2026-10-15-09-56_remove-admin-can-edit.md.Implemented in
00105edonmain. Not deployed yet.server/policy.jscanWriteSessionnow allows a write only from the session's own user, and only while the session isn't archived.Session is read-onlyfor any content change to another person's session.readOnlyfor each viewer.ADMIN_CAN_EDITis removed fromserver/index.js,docker-compose.ymland.env.example..envline is no longer passed to the server and is ignored.warnRemovedSettingsinserver/config.js).web/src/help.tsandweb/src/dashboard.ts. The client already kept staff views of other people's sessions read-only.docs/self-hosting.md,docs/api.md,README.mdandCLAUDE.mdare updated.docs/deployment.mdhas a new release note, "read-only staff review (#10)". Deploying needs no migration.docs/plans/2026-10-15-09-56_remove-admin-can-edit.md(done).Left: deploying. This issue stays open until it's live.
Deployed at
ec6f0cb, together with #8.ADMIN_CAN_EDITis no longer passed to the container: the live.envline is ignored, and the container environment no longer has it. healthz is ok and signed-out requests get 401. Staff review of a client's session is read-only on the server and in the client.