Repository navigation
feat(plugin-auth): Create User can grant a permission set in the same step, through the delegated-administration gate - #25381
Conversation
…mission set, granted under the caller's own context Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
…lated labels Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
…ine param A field-backed param on plugin-security's grant object is refused by the console dialog whenever that object's metadata is not loaded, so the param is declared inline. Re-counts the tenant-audit census for the new write site. Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
…e-user grant pins Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
Re-counts the tenant-audit census on the merged tree. Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
Re-counts the tenant-audit census on the merged tree. Claude-Session: https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 38 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 21 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 dad3e1dedd57761105eae1cba78d469a2b0462b6 && git checkout dad3e1dedd57761105eae1cba78d469a2b0462b6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b22ab8d6fb3462bff05142efc6b6cc040c95f646 74d73286de8229ce79ebe7c631f7c84cd0f5a96b && git checkout -B drift-repro b22ab8d6fb3462bff05142efc6b6cc040c95f646 && git merge --no-ff 74d73286de8229ce79ebe7c631f7c84cd0f5a96b
node scripts/docs-audit/affected-docs.mjs --json b22ab8d6fb3462bff05142efc6b6cc040c95f646
|
席位核对ACCEPT ·
Generated by Claude Code |
Requested by Tesla · project thread
Fixes #25338
Clause-②: yes (widening:
POST /api/v1/auth/admin/create-userand thesys_usercreate_useraction accept an optionalpermissionSet; a request without it is answered exactly as before)Metadata-protocol: none
Companion UI half: objectstack-ai/objectui#13347 (a member who may read none of an app's objects lands on one access page instead of a grid of refusals).
What changes
Create User can grant one permission set in the same step.
create_usergains an optional inlinepermissionSetparam (text, the set's machine name). The result dialog shows it when one was granted.runAdminCreateUser(plugin-auth) parsespermissionSet. When one is named, it resolves the calling administrator's OWN execution context throughresolveRequestExecutionContext(@objectstack/core, session-only, fail-closed) before anything is written, then runs the account creation andengine.insert('sys_user_permission_set', { user_id, permission_set }, { context: <caller's context> })inside oneengine.transaction().PERMISSION_DENIEDfrom the delegated-administration gate, 400VALIDATION_FAILEDwithfieldsfor a name the catalog does not hold), and the transaction rolls the user back.permissionSet(400), a caller whose own context does not resolve (403), a host that wires no grant seam (501).create_userstays hidden underfeatures.cloudManaged(platform-objects: hide invite_user ×4, create_user and set_user_password when features.cloudManaged is on (visible predicates, hide-when-on) #25295).Security floor
sys_user_permission_setthat Setup's grant form makes, under the caller's context, so the security middleware, the ADR-0090 D12DelegatedAdminGate(which stampsgranted_by) and the catalog name check (grant-permission-set-name.ts) judge it exactly as they judge the form. NoisSystemcontext is used for the grant.granted_by= the administrator, which is the gate's own stamp.Verification
plugin-authadmin-user-endpoints.test.ts: 65/65, 8 new cases (none asked; assigned under the actor's context, not system; 403 refusal rolls back and writes no audit; unknown name gives 400 withfieldsand rolls back; no seam 501; unresolved context 403; non-string 400; the param is inline, never field-backed).create-user-permission-set.dogfood.test.ts(showcase boot): 3/3. G1 assignedshowcase_contributorwithgranted_by= admin; G2no_such_set_25338gives 400 and no user; G3 a member caller gets 403 and no user.runAtomicallyreplaced with a plainwork()call (actx.logger.debugmarker, proven indist/byablation-dist-preflight.mjs). G2 goes red: the user survives the refused grant ("expected [ …(26) ] to have a length of +0 but got 1"). Restored to HEAD's blob, rebuilt,--absentpasses. A first leg used a comment marker that the build stripped, so preflight refused it and it measured nothing; it is not counted.platform-objects: 88 files, 1318 tests pass (the create-user result-dialog pin now listspermissionSet).tsc --noEmitclean for plugin-auth and platform-objects.check-i18n-bundlesOK (zh-CN, ja-JP, es-ES translated).tenant-audit-census.mjs --write, and the page's hand-written figures updated to match.Acceptance notes
sys_user_permission_set.permission_set. That object belongs to plugin-security, and the console'sActionParamDialogrefuses the whole action when a field-backed param's object metadata is not loaded. The field-backed form would not have given a picker anyway: a field-backed param takes the field'stype(text), not itswidget: 'permission-ref'hint. A picker for this param needs params to honour a widget hint (objectui), noted here, not filed.beginTransactionruns the account and the grant unatomically, the engine's declared limit (ADR-0119 D1).🤖 Generated with Claude Code
https://claude.ai/code/session_01TpToTVFniSfCoKfhPL16Nz