Commit d34d9c9
* fix(plugin-sharing): scope sharing-rule administration to the caller's organization (#8158)
`SharingRuleService` took its unfiltered admin read branch on the ABSENCE of an
organization id rather than on system-ness, so an authenticated, non-system
caller holding the org-scoped `manage_sharing` capability with no active
organization read every tenant's sharing rules, resolved any of them by id or
name, and could evaluate them — a cross-tenant write, since evaluation
reconciles `sys_record_share` grants.
The three sites that shared the `if (!orgId)` shape (`adminOrgScope`,
`getRule`, `findRuleRowByName`) now take the execution context, and an
authenticated caller with no resolvable organization is refused with
PERMISSION_DENIED (403). System contexts (boot seeding, hooks, backfills) and
platform operators (`manage_platform_settings` / the `platform_admin`
position) keep the unfiltered read unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
* docs(sharing): name the missing-organization refusal on both sharing pages (#8158)
The "Typical Errors" list on `services.sharing` enumerates the exact conditions
behind each status, and the ADR-0111 D6 section of the sharing-rules page is
where a reader of the rule surface looks. This PR adds a refusal to that
surface — an authenticated `manage_sharing` holder whose session resolves no
active organization now gets 403 PERMISSION_DENIED on every verb — so both
pages say so, including which two callers (system contexts, platform
operators) are deliberately unaffected.
Same reasoning as #8217: the runtime refusing more than the page says is the
enforced-but-undocumented inverse of a declared-but-unenforced gap.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent e5bd2f6 commit d34d9c9
6 files changed
Lines changed: 791 additions & 25 deletions
File tree
- .changeset
- content/docs
- kernel/runtime-services
- permissions
- packages
- plugins/plugin-sharing/src
- qa/dogfood/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
164 | 180 | | |
165 | 181 | | |
166 | 182 | | |
| |||
0 commit comments