You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(plugin-sharing): scope getRule's by-id branch to the caller's organization (#7797)
* fix(plugin-sharing): scope getRule's by-id branch to the caller's organization
`SharingRuleService.getRule` resolved an id with a bare `{id: idOrName}`
predicate under SYSTEM_CTX, so nothing re-scoped it downstream. An
org-scoped sharing admin holding another organization's `srule_...` id
could read that org's rule, evaluate it, and — because `deleteRule`
resolves through `getRule` — delete it together with every
`sys_record_share` grant it had materialised, silently revoking another
tenant's record access.
The by-id lookup now carries the same `adminOrgScope` predicate #7760
gave the by-name path: `id = {id} AND (organization_id = {orgId} OR
organization_id IS NULL)` when the caller carries an organization, and
unfiltered when it does not, so system/boot contexts are unchanged.
A platform-global (organization_id = null) row stays reachable by id.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVc1ekPpi6yaWywAUhfzfd
* test(plugin-sharing): pin by-id tenant isolation for getRule/evaluateRule/deleteRule
Adds the [#7761] describe block: another organization's rule is unreachable
by id across all three verbs — and the delete pin asserts the victim's
`sys_record_share` grants survive, not just its rule row, because grant
purging is the actual harm. Platform-global (organization_id = null) rows,
the caller's own rows, and no-org boot contexts are pinned as unchanged.
Also adds the changeset (patch, @objectstack/plugin-sharing).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVc1ekPpi6yaWywAUhfzfd
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments