Repository navigation
fix(platform-objects): the Setup Users list and the user record highlights stop showing the legacy role scalar - #28810
Conversation
…rs list and the user record highlights The all_users list view and the sys_user_detail highlight chips showed better-auth's sys_user.role as the platform role. ObjectStack never writes that scalar; platform-admin standing comes from ADR-0068 D2. The field itself stays readonly text in its Admin group. The #27863 list pin is renamed to sys-user-list-columns.test.ts and pins the new columns, role's absence from every list view and the object highlight fields, and the field's shape. A new page pin checks no record:highlights node or details section draws role. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5msFrPy8g6WzAxVUjG
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 2 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8159540cb62a53289cda0ef52da2888aa84141d8 && git checkout 8159540cb62a53289cda0ef52da2888aa84141d8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c9a9981dae1803fe5270c2171605c1c06508ee89 280a84dd589999dcf8bb9155672cbc430e8c1189 && git checkout -B drift-repro c9a9981dae1803fe5270c2171605c1c06508ee89 && git merge --no-ff 280a84dd589999dcf8bb9155672cbc430e8c1189
node scripts/docs-audit/affected-docs.mjs --json c9a9981dae1803fe5270c2171605c1c06508ee89
|
|
domain:server#5 · os-project-manager · session_01FEkQ5oc56xChD6Wrc4cGSt 席位核对ACCEPT · The maintainer's standing authorisation for landing reviewed PRs, verbatim: 「按照 pm-dispatch 规则复核过的都授权」. 席位意见:与 diff 相符,执行裁决 D1。Setup 用户列表去掉「Platform Role」一列,用户记录页顶部高亮条去掉这一格;
|
domain:server#5 · os-project-manager · session_01FEkQ5oc56xChD6Wrc4cGSt
Requested by Leehom · project thread
Fixes #28105
Clause-②: no
Metadata-protocol: none
维护者速读
all_users视图)去掉「Platform Role」一列;用户记录页顶部的高亮条去掉「Platform Role」一格。字段sys_user.role本身不动:仍是只读文本、仍在 Admin 分组、数据 API 照旧可读。user,种子平台管理员也是user(本地实测见下)。平台管理员身份来自 ADR-0068 D2(所有者邮箱或无组织的admin_full_access),不来自这一列。按裁决 D1(Ruling-ref: 6557746678)撤掉这个误导的展示面;真实身份推导的一列另立 platform-objects: the Setup Users list has no column that says who holds platform-admin standing, now that the legacyrolescalar leaves it (#28105 D1 follow-up) #28793。packages/platform-objects/src/pages/sys-user.page.ts(record:highlights的fields,高亮其实住在记录页,不在对象的highlightFields);packages/platform-objects/src/identity/sys-user.object.ts(all_users.columns);packages/platform-objects/src/identity/sys-user-list-columns.test.ts。pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/identity/sys-user-list-columns.test.ts src/pages/sys-user-record-highlights.test.ts,预期 8/8 通过(main 上 4 红)。What changes
all_userslist view (sys-user.object.ts): columns are nowname, email, phone_number, email_verified, banned, source, created_at.roleis gone;bannedstays (Setup → Users list has no Status (banned) or Role column, so a banned user or an admin cannot be spotted from the list (#27521 row 15) #27863). The column comment says why.pages/sys-user.page.ts): therecord:highlightschip strip ofsys_user_detailis nowemail, phone_number, email_verified. The details grid'shideFieldskeepsrole(its comment now says why: not the platform role, rather than "already promoted to highlights"), and no details section names it, so the record page drawsrolenowhere. The page docblock no longer lists "platform role" among the signals.sys_user.rolefield (Field.text, readonly,maxLength: 64, groupAdmin, label and description), its storage, the better-authdefaultRolestamp, and the ADR-0092 import / create-user pass-through. No synchronisation of platform-admin standing into the scalar. Nopackages/spec/**orui/**edit..changeset/28105-sys-user-role-off-setup-screens.md:patchon@objectstack/platform-objects(served view and page metadata change; no authorable value is refused, no key moves).Tests
identity/sys-user-list-status-role-columns.test.ts(the Setup → Users list has no Status (banned) or Role column, so a banned user or an admin cannot be spotted from the list (#27521 row 15) #27863 pin, PR fix(platform-objects): Setup's user screens show a user's real state, and the copy-password line only when one was generated #28065) is nowidentity/sys-user-list-columns.test.ts, since its name named the Role column. It pins the newall_userscolumns, that nosys_userlist view listsrole, that the objecthighlightFieldsdo not carry it, that every column is a declared field, and thatroleis still readonlytextin groupAdminwith nooptions(ruling 2 guard).pages/sys-user-record-highlights.test.ts: the header chip strip is exactlyemail, phone_number, email_verified; norecord:highlightsnode anywhere on the page (tab children walked) carriesrole; norecord:detailssection draws it andhideFieldskeeps it.d9c4cdc4e(both files against base sources): 4 failed / 4 passed. Red: theall_userscolumns pin, "no list view shows role", the chip-strip pin, "no highlights node carries role". Green on base as well as head: objecthighlightFields(alreadyname, email, email_verifiedon base), every column declared, the role-field guard, the details-section check.@objectstack/platform-objectsfull suite and typecheck green (numbers in Verification). The existingpages/sys-user-details-tab.test.tspin ofhideFieldsis unchanged and green.Acceptance notes
rolewas not the object-levelhighlightFields(['name', 'email', 'email_verified']on base) but therecord:highlightsnode of the record pagesys_user_detail. No compact layout exists (compactLayoutis a retired key). The claim's file surface was amended to add the page file and its folder's tests.sys_user.role(order assumption 2). No other platform view, dashboard, report or example reads it as a column. Therolecolumns insys_member,sys_invitation,sys_scim_projection_grantand the related lists on the organization and user pages are membership / grant roles of other objects, not this scalar. Non-Setup readers left alone: the Console import panel'srolecolumn (ui/packages/app-shell/src/views/IdentityImportPanels.tsx, the ADR-0092 import pass-through), the expression-contextuser.roleand its${user.role === 'admin'}example inui/packages/app-shell/src/providers/ExpressionProvider.tsx(the ui finding the seat carries), andpackages/qa/dogfood/test/admin-ledger-decision-metadata.dogfood.test.ts, which reads the field label, not a list column.Platform Role(ruling 2: no field change), so the standard edit form and the data API keep that label. Noted, not changed.roleinto their own column list keep it; this PR changes only the shippedall_usersdefault.content/docs/**page pins the Users list columns (grep for the column list,all_usersandPlatform Roleundercontent/docs: zero hits).Verification
Live probe, stock showcase boot, base vs head
Commands (each leg on a fresh boot, platform-objects
dist/rebuilt for that leg; the base leg wrote the base blobs of the two source files over the head copies, then restored them withgit checkout HEAD --,git diff HEADempty and both blob hashes equal to HEAD before the headdist/was rebuilt):d9c4cdc4e(port 4625)all_users.columnsname, email, phone_number, email_verified, banned, role, source, created_atname, email, phone_number, email_verified, banned, source, created_athighlightFieldsname, email, email_verifiedname, email, email_verifiedrecord:highlights(header)email, phone_number, email_verified, roleemail, phone_number, email_verifiedrecord:highlights(Security tab)two_factor_enabledtwo_factor_enabledfields.roleHead data read:
admin@objectos.ai(the showcase's seeded dev admin) answers"role": "user";auditor.demo@example.comanswers"role": null. That is the wrong value the ruling describes, and the field stays readable through the data API.Gates, local subset, at head 280a84d (59 derived families, all exit 0)
Derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon the real diff (merge basec064d3a2), each run with its exit code captured before any pipe, then reconciled:dispatch-gates --ran: 59 derived famil(ies) accounted for — 59 run, 0 NOT-MEASURED.check-plugin-teardown-shape --self-testfirst exited 3 on the shallow clone; aftergit fetch --depth=1 originof its positive-control commit it passes 48 cases.Also at this head:
pnpm build(117/117 tasks),pnpm --filter @objectstack/platform-objects typecheck(exit 0),pnpm --filter @objectstack/platform-objects test(108 files, 1503 tests passed),pnpm exec eslint --no-inline-config packages/platform-objects(exit 0).test:repoand the full farm are CI's.Generated by Claude Code