Skip to content

Owner admission beside an authored update policy (delete parity, shares and queue) #39467

Backlog

Description

@objectstack-fleet

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

Problem

Follow-up from PR #39448 (Fixes #39339), L1-b record #39448 (comment), follow-up 2.

#39448 lets ownership admit delete beside an authored delete policy (ruling C, #38517 comment 7288570890), but only for delete. Update on private / public_read objects has the same shape by code reading (not measured): an owner who did not create the row keeps the creator floor beside an authored update policy. The update allow from the sharing service also carries edit shares and the record queue, which neither ruling A (7063130499) nor ruling C covers, so emptying the floor for update would admit share and queue holders too.

Choice

  • A: extend ruling C to update for the owner term only (owner admits; shares and queue stay floored).
  • B: extend it to the whole update allow (owner, edit shares, queue).
  • C: keep update as is and document the asymmetry with delete.

Needs the maintainer's ruling; the four-axis analysis is owed on this card.

Area: data
File surface: packages/plugins/plugin-security/src/security-plugin-rls-filter.ts

Activity

  1. added
    priority:p2
    needs-user-decision
    domain:server
    on Dec 4, 2026
  2. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxhJCxxgNFHE9Ar94a

    维护者速读

    • 问题:应用给“商机”这类有负责人的对象另写一条编辑规则(例如“已关闭的商机谁都能改”)之后,接手别人录入的商机的销售改不了自己名下不满足规则的商机,被同事共享了编辑权的人和队列成员也一样被拒,而不写这条规则时他们本来都能改;删除那边即将改成跟着负责人走,编辑不改就成了两套说法;今天真实应用里的编辑规则都写成“全部放行”,所以还没有人撞上,本次是实测复现的。
    • 选项:第一种只让负责人和他的上级恢复编辑,被共享者和队列成员仍被规则挡住,约一个改动;第二种让不写规则时本来就能改的人(负责人、被共享编辑权的人、队列成员)全部恢复,不给任何人新增原本没有的权限,约一个改动;第三种保持现状,把“删除跟负责人、编辑不跟”写进文档,约一个文档改动。
    • 推荐:第二种全部恢复,理由是“应用多写一条放行规则只会多放行,不会收走别人已有的权限”这句话要对所有人都成立,只恢复负责人会留下“明明共享了编辑权却改不了”的半截状态。
    • 不定会怎样:编辑和删除两套说法并存,文档和教给 AI 的写法给不出一句话的规则,第一个写“部分放行”编辑规则的应用上线后,负责人、被共享者和队列成员会被莫名拒绝。

    Served-tier: CONTRACT_REVIEW_TIER
    Analysed-by: session_016WV4cxhJCxxgNFHE9Ar94a

    Analysis (English)

    One-sentence problem. Once an app writes its own edit rule for an object, the people who could edit a record before the rule existed (the owner who took it over, a colleague it was shared with for editing, a member of the queue it sits in) are refused on every record the rule does not match, and the pending delete fix would leave edit and delete following different rules.

    Background

    Governing text

    • Ruling A, record 7063130499: "An authored update/delete using policy stays a widening OR term (the "any rule allows ⇒ allowed" reading that the spec, sharing-rules.mdx and the skills teach). An authored check still bounds an update."
    • Spec, packages/spec/src/security/rls.zod.ts:122: "Default Deny, among the policies that apply"; :504 "multiple policies (they OR-combine)". Grep: grep -n "OR-combine\|Default Deny, among" packages/spec/src/security/rls.zod.ts.
    • Docs, content/docs/permissions/sharing-rules.mdx:123-125: "policies OR-combine within an object, so members keep the owner gate while supervisors widen to the org". Grep: grep -n "members keep the owner gate" content/docs/permissions/sharing-rules.mdx. The docs promise that an update widener leaves the owner's access in place.
    • Ruling 5219846435 on Row-level write gate consults neither modifyAllRecords nor sys_record_share.access_level — both declared write-widening mechanisms are inert #5492: the edit share is a declared write-widening mechanism to be enforced.
    • Sharing contract, packages/spec/src/contracts/sharing-service.ts:15-18: update is answered by "ownership (widened by write DEPTH), a write-level (edit) share, or the modifyAllRecords super-user bypass"; the queue basis is ADR-0142 D3 (ADR status: Proposed, amended by rulings).
    • ADR-0066 ①, docs/adr/0066-unified-authorization-model.md:64: Modify All bypasses write-side RLS only where the object's posture permits. It rules Modify All out of every option here.
    • None found: a spec line, ADR decision or ruling that says an authored update policy takes edit away from an owner, a share holder or a queue member, and none that says it must not. Search: node scripts/pm/check-prior-rulings.mjs --terms "owner_id,update,share,queue,RLS,created_by" --card 39467 (81 ADR hits, none on this composition; card thread: 0 rulings).

    Protocol statement

    The protocol says policies add up, and the docs say an update widener leaves the owner gate in place. No option adds or removes a key (Metadata-protocol: none). A and B widen behaviour toward that statement (Clause-②: yes (widening)). C keeps behaviour and changes the docs to say that an authored update rule also replaces record access for the people it applies to, which is the documented contract following the implementation.

    Premises, each with a re-check

    1. PR fix(security): the owner deletes a record beside an authored delete policy #39448 is an open draft; the delete side of the asymmetry is not on main yet. gh api repos/objectstack-ai/objectstack/pulls/39448 --jq '.state,.draft,.merged' reads open, true, false.
    2. The card says update "has the same shape by code reading (not measured)". Now measured, and an existing pin already covered part of it: grep -n "BOB (owner, created none)\|edit-share target DAVE under the wideners" packages/plugins/plugin-security/src/predicate-write-floor-deferral.test.ts (lines 867, 876; the file's [#35917] block ran 22 passed in a throwaway copy of main 55d673c).
    3. Measured for this analysis (same throwaway copy, real security and sharing plugins on SQLite, by-id update at the engine door, authored update policy stage == 'closed', open rows; identical with and without PR fix(security): the owner deletes a record beside an authored delete policy #39448's source hunk; the matrix is not committed):
    Caller, open row the policy does not admit private public_read same object model, no authored policy
    owner, not the creator refused 403 refused 403 updated
    owner and creator updated updated updated
    edit-share holder, neither owner nor creator refused 403 refused 403 updated
    declared write depth org, no Modify All refused 403 refused 403 updated
    Modify All holder who owns the row, not the creator refused 403 refused 403 updated
    Modify All holder who created the row updated updated updated

    Queue membership was not measured (no queue in the rig).
    4. The update allow carries four bases. grep -n "3. UPDATE only\|5. ownership, widened by write DEPTH\|6. UPDATE only\|7. \[#4647\]" packages/plugins/plugin-sharing/src/sharing-service.ts (lines 1400, 1408, 1409, 1415): queue, ownership by depth, edit share, Modify All.
    5. Where an authored term remains, the gate is kept beside it. grep -n "allRlsPolicies = collected" packages/plugins/plugin-security/src/security-plugin-rls-filter.ts (line 444).
    6. Who writes authored update policies today. grep -rn -E "operation: 'update' as const" examples packages/apps /home/user/hotcrm/src --include=*.ts | grep -v "\.test\." gives 3 hits: HotCRM's marketing_campaign_updates and marketing_campaign_member_updates, both using: 'id != null' (every row), and the showcase's invoice_owner_immutable, which is check-only. No authored update policy admits only some rows, so no option changes one answer in these apps. HotCRM at 63a4c0b; the cloud app repo and live deployments were not read.
    7. An update also has a post-image check that defaults to the using terms, the platform gate included. grep -n "platformFloorYieldsToObjectWriteModel" packages/plugins/plugin-security/src/security-plugin-rls-filter.ts. Delete has no such half, so PR #39448's one-line shape does not carry over as is. Read, not measured.

    The concrete question

    Beside an authored update policy that does not admit the row, on an owned private or public_read object: which of the reasons that let a person edit the row when no such policy exists still admit it, namely ownership (with depth), an edit share, queue membership?

    Not asked: Modify All by itself (ADR-0066 ① keeps it out under every option), and the check on the row as written (unchanged under every option).

    Options

    Option What it does What the customer sees Effort
    A — owner only Ownership (owner, a manager above by depth) admits the update beside the authored policy. An edit share and queue membership stay behind the gate. A rep edits the deals assigned to them whatever the app's edit rule says. A colleague the deal was shared with for editing, and queue members, are still refused on records the rule does not match, although they edit them where no rule exists. domain:server · 1 PR · nearest landed: PR #36117 +512/−85, 11 files (row gate, defaulted check, explain). Telling ownership apart from share and queue inside one allow: 无先例.
    B — the whole record-access answer Whatever lets a person without Modify All edit the row where no authored policy exists (ownership, edit share, queue) also admits it beside one. Adding an edit rule never takes edit away from anyone. Nobody gains a record they could not already edit on an object without the rule. domain:server · 1 PR · nearest landed: PR #36117 +512/−85, 11 files; the delete twin PR #39448 is +408/−14, 5 files (open draft, unlanded).
    C — keep, document the asymmetry No runtime change. Docs and the data skill say delete follows the owner beside an authored rule and edit does not. Owners, share holders and queue members are refused (403) on records outside the app's edit rule. Builders must restate ownership inside every edit rule. docs/skills · 1 PR · landed precedent: PR #39327 +34/−13, 4 files.

    What each option means in business terms

    • A: your own desk stays yours when the office posts a new access list, but a key a colleague lent you stops working.
    • B: a new access list only adds names; every key that worked yesterday works today.
    • C: once the office posts any access list for your role, it is the whole rulebook for editing, and only the person who typed a record in is exempt.

    Four axes, from the business standpoint

    ① Long-term soundness. A builder and an admin need one sentence for what an edit rule does. The spec, the docs and ruling A already give it: a rule admits the rows it matches and rules add up. B makes that sentence true for everyone the platform lets edit a record, with one named exception that an ADR already rules (Modify All). This is the mainstream shape: in Salesforce, owner, role hierarchy, manual shares with Read/Write and queue membership each open edit and nothing an admin adds closes them (restriction is a separate construct); in Dataverse, owned-record privileges, shared access and team membership union; Postgres permissive policies OR. A honours the sentence for owners and keeps a second class of grant, the edit share, that works only until the app writes any edit rule for the role; that is a new special case, and a share that is stored and shown but not honoured is the "declared, not enforced" shape ruling 5219846435 was made to end. C makes edit and delete disagree about what ownership means beside an app rule and asks the docs to describe an outcome that came from where a fix happened to stop. In two years: "a row policy adds access beside record access (ownership, depth, shares, queue); caps live in the check, validation rules and field locks; edit and delete read ownership the same way."

    ② Real pull. Zero measured for all three. The only authored update rules found admit every row or are check-only, so no app's answer moves. The pull behind the mechanisms is real and ruled: #5492's HotCRM sweep found "manager fixes it" and shared-edit workflows unusable, and the maintainer ruled both be enforced. The first app that writes a partial edit rule brings the refusals of premise 3 with it. No taught example of a partial update rule was found (the docs recipe at sharing-rules.mdx:121 admits every row in the organization); the data skill does teach a partial delete rule (skills/objectstack-data/rules/security.md:34, status != 'approved'), so the shape is one authors are steered to.

    ③ Keeping AI from getting it wrong. All refusals are loud (403). The silent side is elsewhere: under A and C, an AI that adds "anyone may edit an open deal", reading it as the widening the docs describe, quietly disables edit shares and queue work on closed deals; nothing at publish time says so, and the person who shared the record sees the share accepted. Under B the rule does what the docs say a rule does. The opposite mistake, an author using an edit rule as a cap, is already not honoured for creators since ruling A; B extends that to owners, share holders and queue members, all of whom edit the record on an object with no rule, and the declared home for a cap (the check, a validation rule, a field lock) is unchanged. This is a widening on a permission boundary, so it is the maintainer's call by rule.

    ④ Startup focus. No option adds a key or a gate. B is the smallest runtime rule (one composition for both verbs, no need to tell one reason for allow from another). A needs a new distinction inside the record-access answer. C adds a standing documented asymmetry that every later change must keep true.

    os-decision-facets
    ① 项目长远合理性: B leaves one sentence true for everyone (a write rule only adds) with Modify All as the single ADR-ruled exception; A keeps edit shares and queue as a second-class grant; C makes edit and delete read ownership differently and documents it.
    ② 实际业务拉动: zero measured, the three authored update rules found admit every row or are check-only; edit shares and Modify All were ruled "declared, enforce" on HotCRM pull (ruling 5219846435); no partial update rule is taught or found, a partial delete rule is taught in the data skill.
    ③ 防 AI 犯错: refusals are loud under all three; under A and C a widening rule silently disables edit shares and queue work on rows it does not match; under B the rule does what the docs say.
    ④ 创业阶段不扩散: no new key or gate anywhere; B is one composition for both verbs; A adds a distinction inside the record-access answer; C adds a permanent documented asymmetry.
    Prior rulings read: owner_id,update,share,queue,rls,created_by → 81 hits; ADR-0066 ① and Precedence §3, ADR-0111 D3; thread: none
    Off-thread rulings read: 7063130499 on #35917, 7288570890 on #38517, 5219846435 on #5492, 5226389104 on #5493. ADR-0142 D3 was read through the sharing service docblock only.

    Recommendation and confidence gaps

    Recommend B. It is the only option under which the already-ruled reading ("an authored using policy stays a widening OR term") holds for every person the platform lets edit a record, and it grants nobody a record they could not already edit on an object without the rule.

    • Not A: it fixes owners and leaves the same defect for edit shares and the queue, a half measure that also needs a distinction (which reason produced allow) with no precedent.
    • Not C: it documents an asymmetry between edit and delete that no ruling chose, and leaves a rule written to widen narrowing three groups of people.

    Decide together with #39464. The clearest combined rule: beside an app's own write rule, each person keeps what record access gives them without the rule (ownership for delete; ownership, edit shares and the queue for update); Modify All by itself adds nothing there, and holding it takes nothing away. That is #39464 A plus this card's B, on one mechanism. Each letter stands on its own if the other card is ruled differently.

    Confidence gaps:

    • Zero measured pull. The recommendation rests on ①; ② only says there is no urgency (p2, after PR fix(security): the owner deletes a record beside an authored delete policy #39448).
    • Neither ruling A nor ruling C covers shares or the queue, and ruling C's point 2 says update keeps today's behaviour within that ruling's scope. B is a new ruling, not an execution of an old one.
    • The queue basis rests on ADR-0142, whose status is still Proposed, and queue membership was not measured here.
    • The update path has a post-image check that delete lacks (premise 7). The build is larger than PR fix(security): the owner deletes a record beside an authored delete policy #39448's and its size is not known; I give no estimate beyond the named precedent.
    • An app that has relied since PR fix(plugin-security): enforce both declared write-wideners; the platform baseline becomes explicit-allow (#5492, #5491) #6684 on an edit rule stopping owners or share holders would silently widen under A or B. None found; the cloud app repo and live deployments were not read.
    • Adjacent finding, measured, outside every option: on a public_read_write object the same authored update policy refuses everyone, the owner-creator included, on rows it does not match, although without the policy every member edits them. Record access abstains there, so A and B do not reach it. Not searched for an existing card beyond one query.
    • Measured at the engine door by id only; REST, the predicate (bulk) path and security/explain were not measured for update.

    Self-check. 「只看①选 B;②③④ 是否翻转:否」 (② is zero pull and moves timing only; ③ is mixed, loud either way, and does not turn the letter; ④ reads B.)

    After the ruling

    If B:

    • Lane and PR: domain:server, one PR on packages/plugins/plugin-security, after PR fix(security): the owner deletes a record beside an authored delete policy #39448 lands and on the same mechanism as Modify All holder who owns a row is refused delete that a plain owner gets #39464 if that card is ruled A. Patch changeset in customer words, Clause-②: yes (widening), Metadata-protocol: none.
    • The dev verifies first, on current main: (1) the refusals of premise 3 reproduce, and a queue member's refusal is measured; (2) every row whose answer changes is one the same caller updates on an identical object with no authored update policy; (3) the post-image check gives the same answer as the pre-image gate for each changed row, and an authored check still refuses; (4) the by-id and predicate updates agree row for row, and security/explain agrees with both.
    • Pins: owner-not-creator, manager above the owner, edit-share holder and queue member each update a row the policy does not admit; a read-share holder, a stranger and a creator who no longer owns the row are still refused; a Modify All holder who neither owns nor created the row is still refused (ADR-0066 ①); an authored check control still refuses; an object with no owner column keeps the creator rule; the delegated (on-behalf-of) update is unchanged. Each pin ablated.
    • Docs in the same PR: the known-limitation and recipe text in content/docs/permissions/sharing-rules.mdx and the write-rule lines of skills/objectstack-data/rules/security.md.
    • ⛔ Fork rule: if any changed row is one the caller could not update without the policy, or the post-image check cannot be made to agree, stop and report. ⛔ No partial landing as "owner only", and no always-true term that would also admit Modify All.

    If A: the same PR and pins with the share and queue cells pinned as refused, plus the docs sentence that an edit share does not work beside an authored edit rule; the dev first shows how ownership is told apart from the other reasons for allow. If C: one docs/skills PR and one pin for the owner-not-creator update refusal; no runtime change.

    Related cards and PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:serverneeds-user-decisionpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions