Skip to content

console: the record create/edit dialog shows only "You don't have permission to save this record." on a controlled_by_parent master-edit refusal, dropping the API's reason ("requires edit access to its master record"); #7366 regression on this path #33524

Closed

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAnPkgK6CWrJa6t7Fk5

What happens (@objectstack 18.4.0, measured by HotCRM's Order to Cash browser pass on 2026-11-14)

A user who reads a contract but does not edit it opens the create dialog of a controlled_by_parent detail (HotCRM crm_billing_milestone, crm_invoice) and saves. The API answers 403 with a reason saying the write requires edit access to its master record. The console shows only the generic toast: "You don't have permission to save this record." The user cannot tell that the missing access is on the contract, not on the record they are creating.

#7366 (closed) fixed "Console discards the server error message on 403". This path either does not take that fix or has regressed.

Ask

On a 403 whose envelope carries a userMessage (or a master-chain reason), the create and edit dialogs show it, as they do for other refusals.

Acceptance

  1. A master-edit refusal on create shows the server's reason, naming the master object, in the dialog or toast, in en and zh-CN.
  2. The same applies on edit.
  3. A refusal with no userMessage keeps the generic line.

Activity

  1. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:ui · p2 · pm:queue · 2026-11-14T23:44Z

    ⛔ Not a claim.

    The refusal is loud, but the console drops the reason that says which record needs edit access. On its own that is p3 copy. HotCRM's Order to Cash users hit it on 18.4.0, so it is raised once to p2. It looks like the #7366 fix does not cover the create/edit dialog path: check which error shape that path reads.

  2. added
    bug
    domain:ui
    pm:queue
    on Nov 14, 2026
  3. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

    Claim: PM loop round 1 · 2026-11-15T00:13Z
    Session: session_01FEkQ5m1xDT63aCaQJNjwXD (card thread, dev) · seat session_01FEkQ5oF8GgTHN2jBZoDwz8
    Account: os-project-manager
    Branch: claude/project-thread-bhbxol
    Worktree: objectstack-issue-33524
    Domain: domain:ui
    Seat: domain:ui#2
    File surface: ui/apps/console/src/components/FormPage.tsx (the permission-refusal text), the plugin-form modal/drawer submit refusal path if that is the create dialog, ui/packages/app-shell/src/providers/saveAdvisoryToast.ts, the error-toast reader in ui/packages/app-shell/src/utils/ (flowResponse.ts), their tests, i18n packs only if a key is truly new, root .changeset/. The dev declares the final files per half at first hand-back. ⛔ No packages/spec, server or cloud edit.
    Container & model: M, mode:thread, model: default tier, effort: default
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the console's create/edit dialog replaces a 403's producer userMessage (plugin-security's master-edit refusal) with the generic permission line | the producer already sends the localized reason (#33290) | every user saving a controlled_by_parent detail without edit access on its master (HotCRM Order to Cash)
    Thread-read: 6886080721
    Premise: read at filing on 18.4.0 by HotCRM's browser pass; not re-measured by the seat; the dev measures on origin/main first
    Serial constraints cleared: no other pm:dispatched domain:ui card claims a file in this surface (live label read; ui seat 1's live files #33317 #33063 #33061 #33103 #33377 are disjoint); no other ui seat holds a Claim: on these files

    Scope: shared card thread with #32657 (one dev, one PR Fixes #33524 + Fixes #32657 if both halves land, else one PR per card). p2. Order: /mnt/project-files/pm-orders/ui/order-33524.md. Summons: the maintainer's 「同意 给队列最深的 ui 和 spec 各再开一个座位」 (this project, 2026-11-14T22:46Z).

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  5. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

    Claim amendment · Premise: corrected · 2026-11-15T00:16Z · to claim 6886417201. Dev's measurement on e3f0cfd4 (/mnt/project-files/pm-orders/ui/33524-measurement.md):

    • The create dialog HotCRM opens is the console's modal form, and its renderer already reads the producer's userMessage first (as do the record form page and the edit conflict path). The generic "You don't have permission to save this record." shows only when the refusal carries no userMessage.
    • The master-edit refusal carries none: packages/plugins/plugin-security/src/security-plugin-cbp-write-gate.ts (~L463, the master-edit denial) throws a bare permission error with English developer prose and no user message. fix(plugin-security): permission refusals speak the caller's language, falling back to the workspace default (#32656, 2/2) #33290 localized the other permission refusals, not this one.
    • So acceptance 1 and 2 are a server fix (plugin-security composes a localized userMessage naming the master record), outside the ui lane.

    The ui half shrinks to rendered pins proving the dialog shows a userMessage on create and edit (en and zh-CN) and keeps the generic line without one. That ships in the shared PR as Refs #33524, with no product change. After it merges, the seat releases this card to triage with pm:retriage to re-lane it to domain:server.

  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

    Seat review: PR #33576 ACCEPT on head 2018f35e (2026-11-15T01:54Z). K = 19, base-synced through the relay and CI green on the synced head; ready + auto-merge set in the same stroke. Contract record PASS 6887157614. #33524 (pins only here, Refs) is released for re-laning to domain:server once this merges.

  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8

    Released for re-laning · 2026-11-15T04:16Z

    reading value
    PR #33576 MERGED as d95ddebc on main, Refs #33524 (pins only for this card)
    console half does not reproduce: ModalForm already shows a refusal's userMessage (pin ui/packages/plugin-form/src/ModalForm.markedRefusal-33524.test.tsx, 6/6 green on base and head)
    producer half plugin-security's masterEditDenied refusal sends no userMessage, so the console has nothing to show (premise correction on this card)

    State: pm:dispatched removed, assignee cleared, pm:retriage added. The remaining work is server-side (domain:server, plugin-security: the master-edit refusal carries a producer-marked, localized userMessage as #33290 does for the other permission refusals). Triage re-lanes and re-grades; the ui seat holds no claim on this card.

  8. added
    pm:retriage
    and removed
    pm:dispatched
    on Nov 15, 2026
  9. 2 remaining items

  10. added
    pm:queue
    and removed
    pm:retriage
    domain:ui
    on Nov 15, 2026
  11. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim: server area S1 (A1+A2) under #33751 §2 area-lease mode, area A2, seat domain:server#5 · p2 · executed by an os-dev subagent of the area S1 thread · posted at 2026-11-15T09:38Z
    Session: session_01QsR2jVPGBoi3MCGoKbW1Hv
    Account: zhuangjianguo
    Branch: claude/area-A2-33524
    Worktree: objectstack-area-A2-33524
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/plugins/plugin-security/src/security-plugin-cbp-write-gate.ts (the master-edit denial), the plugin-security refusal-copy/translation module that PR #33290 (a1e0402) uses for the other permission refusals, their tests, a changeset (stop on breach; explain in the report)
    Container & model: S-M, mode:subagent, model: default (no path-derived mandate; dispatch-gates --tier at d7e1a5aa), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: plugin-security masterEditDenied refusal carries no producer-marked userMessage (objectstack) | the console already renders a refusal's userMessage (PR #33576, d95ddebc) | users who read but cannot edit a master and create/edit its controlled_by_parent detail; HotCRM Order to Cash on 18.4.0
    Thread-read: 6889339502
    Premise: corrected 6889055774
    Serial constraints cleared: #33696 (this area, cbp read filter, no code written, on hold for a decision); #33683 (plugin-sharing, disjoint); no other in-flight claim names cbp-write-gate.ts

  12. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  13. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Claim amendment · 2026-11-15T09:43Z · to claim 6892443581 · file surface widened by the area (routing, no ruling change)

    The dev measured on a557fa3: #33290's helper (userFacingDenialMessage / withUserMessage in authz-middleware.ts) renders copy from BUILTIN_OPERATION_MESSAGES in packages/spec/src/system/operation-message.ts, and no key there names a master. The copy goes into that one catalog, not a second table in plugin-security.

    File surface now: packages/plugins/plugin-security/src/security-plugin-cbp-write-gate.ts, packages/plugins/plugin-security/src/authz-middleware.ts (step 2.8 only), packages/spec/src/system/operation-message.ts + its test (new master-edit keys in every locale the catalog carries; a withheld or unreadable master stays opaque), their tests, one changeset (spec + plugin-security, patch).
    Clause-② stays no: the catalog is typed Record<string, Record<string, string>>, so a new key adds data, not public type surface. The dev confirms this on the built declaration closure in the report.
    Metadata-protocol: none (unchanged).

  14. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv
    os-dev-report

    Reported at 2026-11-15T14:05Z.

    {
      "issue": 33524,
      "status": "done",
      "branch": "claude/area-A2-33524",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33884",
      "head": "10f67c23",
      "session": "session_01QsR2jVPGBoi3MCGoKbW1Hv",
      "premise_still_valid": true,
      "summary": "The master-detail write gate's 403 (masterEditDenied and its reworded form for a caller who cannot read the master reference) now carries a userMessage. It is rendered from four new operation-message catalog keys (master_record_edit_denied / master_record_read_denied with {{master}}, plus _opaque forms) in en, zh-CN, ja-JP and es-ES. Locale ladder: request locale, then workspace default, then en. The master is named by its translated label, else its declared label, else the opaque form, never by API name. A caller who cannot read the reference always gets the opaque form. code, status, message and details are unchanged, and so is every decision. The throw site is authz middleware step 2.8, so insert, update, delete, transfer, restore and purge all carry it. nullMasterOwnerDenied is unchanged and carries no userMessage (CONTROL).",
      "files_changed": [
        ".changeset/33524-master-edit-refusal-user-message.md",
        "packages/plugins/plugin-security/src/controlled-by-parent-master-edit-user-message.test.ts",
        "packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts",
        "packages/plugins/plugin-security/src/security-plugin-cbp-write-gate.ts",
        "packages/spec/src/system/operation-message.test.ts",
        "packages/spec/src/system/operation-message.ts"
      ],
      "tests": "New real-engine pin controlled-by-parent-master-edit-user-message.test.ts: 11/11 (create en/zh-CN, edit en/zh-CN, delete, workspace fallback, declared-label fallback, read question, withheld opaque, unlabeled opaque, CONTROL, REST mapDataError relay). Ablations, each restored with git diff HEAD empty: (1) drop the withUserMessage attachment: 10 failed / 1 passed (CONTROL green); (2) withheld refusal records the master: 1 failed, received the named zh sentence instead of the opaque one; (3) nullMasterOwnerDenied records a master: CONTROL failed ('userMessage' in e, expected true to be false); (4) API-name fallback: 1 failed, received 'You need edit access to the mue_vault...'. Head 10f67c23: plugin-security 268 files / 6692 passed / 45 skipped; spec operation-message.test.ts 47/47; plugin-security + spec typecheck exit 0; spec check:generated 'All 14 generated artifacts are up to date'; rest data-controlled-by-parent-master-refusal-wording 9/9. Head cf6ef429 (before one main merge that touches none of the 6 files): spec full suite 842 files / 26946 passed; dependents: rest 412/412 files, runtime 603/603, plugin-auth 277/277, organizations 18/18, service-automation 282/282, plugin-dev 10/10, cloud-connection 81/81, verify 52/52; cli --project unit 419/421 files, 5971 passed, 0 failed tests (2 files refused in setup: packages/cli/dist not built, NOT MEASURED, left to CI).",
      "gates": "dispatch-gates --commands on cf6ef429: 92 run, 90 exit 0; check:dual-build-cjs-loads and check:i18n exit 3 (PREREQUISITE NOT MET), NOT MEASURED, left to CI. --ran with exit codes: '92 derived, 90 run, 2 NOT-MEASURED, 0 UNRUN'. pnpm lint exit 0; pnpm --dir ui run check:spec-symbols exit 0; check-nul-bytes exit 0. PR body gates: check-changeset-no-major, check-adr-0087-registration, check-closing-keyword-parity and check-partof-closing-keyword all exit 0. PR check-runs on 10f67c23 at report time: 56 success, 11 skipped, 0 failure.",
      "dogfood_battery": "n/a: no `!` in the PR title and no (narrowing) arm; the merge-queue Dogfood gate runs it",
      "contract_self_check": "Clause-② no: no accept set widened or narrowed, no export added (masterGateRefusalUserCopyOf is module-internal; 0 hits in plugin-security dist/index.d.ts). BUILTIN_OPERATION_MESSAGES is declared Record of string to Record of string to string in spec dist/system/index.d.ts, and the new key names appear in no .d.ts or .d.mts. Nothing served is refused, so no `!`, BREAKING banner or ADR-0087 marker. Metadata-protocol none, matching the record_queue_assign_denied precedent. dispatch-gates --tier: no path-derived mandate; operation-message.ts is flagged as a SUSPECT clause-② surface (a hint) and judged above. Comparison: #33769 declared yes (widening) for new root exports and a public method, and #33646 yes (narrowing) for changed served answers. This PR has neither.",
      "line_budget": "504 changed lines (+489 / -15), under 3000; no skills/** touched",
      "mcp_calls": "0",
      "api_writes": "2: pr_create via the fleet-write relay (PR #33884) and this comment via post-stamped",
      "deviations": [
        "The PR opened at about 13:17Z, before the 13:55Z contract self-check rule. The self-check was run afterwards and the claim's lines hold.",
        "The seat's dependent-package suites ran on cf6ef429, not the final head 10f67c23 (one merge of main touching none of the 6 files). On the final head the touched packages were re-run."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "loose-end, noted not filed, carrier: none: a refusal from a hop above the immediate master names the immediate master, and its edit/read question mirrors the diagnostic message's question. That is accurate for edit; on a read-question hop above the first, the sentence says read on the immediate master. Recorded in the PR's Acceptance notes."
      ]
    }
  15. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

    Landed: PR #33884 merged as c59198f; card closed by its Fixes line. pm:dispatched removed · 2026-11-15T16:05Z

  16. removed
    pm:dispatched
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions