Hide logged-in from assignable-role palettes
The logged-in role must never be offered as an option when assigning roles. It is automatically granted to every user except guest (verified live <span class="timestamp-wrapper"><span class="timestamp">[2026-09-25 Fri]</span></span>: a fresh be-insert :users comes back holding "logged-in", its name:exclusive, "public", "settings"), so offering it is at best noise and at worst the false impression that it is toggleable.
Still leaking (verified live <span class="timestamp-wrapper"><span class="timestamp">[2026-10-16 Fri]</span></span>) — both branches, not just admin (the original admin-only framing here was wrong):
(selectable-roles :todos "admin")— the:rolespalette on every non-base type (resource-role assignment), admin branch.system-exclusivesinselectable-roles(lisp/backend.lisp) lacks"logged-in".(selectable-roles :todos "alice")— the non-admin branch leaks the same way: every non-guest user holds"logged-in"(it rides in viauser-roles), and the samesystem-exclusiveslist filters that branch's assembled list.
One path this item used to list is dead: the :roles type's own :roles list (allowed-values → be-list-column :roles :name) no longer exists — :roles is :base t, so allowed-values never appends the synthetic palette (verified live: (allowed-values :roles "admin") returns keys (:PERMISSIONS)). The roles rows in the Admin view are records, not an assignment palette; decision: that display is legitimate and stays.
Already clean (do not duplicate; DONE 2026-08-09 "logged-in role should be not be shown in Add form" + the exclusives follow-ups): :users :roles via allowed-values-for-field, the users list Roles column via add-roles-to-view (both strip "logged-in"), and the write path re-attaches it on save (update-roles reattach list).
Fix shape: add "logged-in" to system-exclusives (one edit, covers both selectable-roles branches). The write path needs nothing: records already holding "logged-in" keep it (held-but- hidden values ride through the form submit). Frontend needs nothing: App.tsx renders the palette the backend sends.
Plan: hide-logged-in-plan.org.
Fixed 2026-10-16: added "logged-in" to system-exclusives in selectable-roles (lisp/backend.lisp), docstring extended to name the full exclusion. Covers both branches: admin leaked it through the full role list, non-admin through user-roles (every non-guest user holds it) — the original item's "admin-only" framing was wrong. Test updates in tests/backend-tests.lisp: selectable-roles-admin expected-set plus an explicit is-false, selectable-roles-non-admin gained the is-false (with the hold-first guard comment). No frontend, write-path, or compiler changes: records already holding logged-in keep it (the edit form renders palette options only; held-but-hidden values ride through the submit), and update-roles reattaches it on :users saves (D12).
The item's second path (the :roles type's own :roles list via allowed-values → be-list-column) no longer exists: :roles is :base t so allowed-values never appends the synthetic palette (verified live: keys (:PERMISSIONS)). The roles rows in the Admin view are records, not an assignment palette; they stay.
Verification: live probes clean (admin + non-admin on :todos; :users palette still lists ai-user / deployer for admin); run-backend-tests 568/568; full run-tests 34 suites, all Fail: 0.
- Slot
- 1900
- Status
- 60 Done
- Tags
- mvp, backend, frontend, bug
- Contributors
- Donnie