feat(sharing): ADR-0056 D6 — configurable role-hierarchy widening (role_and_subordinates)#2069
Merged
Merged
Conversation
…le_and_subordinates) Implement the role_and_subordinates sharing-rule recipient: a new RoleGraphService walks sys_role.parent to expand a role to itself + all subordinate roles' users, wired into expandRecipient and selectable on sys_sharing_rule.recipient_type. Closes the silent no-op where Role.parent was declared but never consumed. Declarative + per-rule configurable (Salesforce "grant access using hierarchies"). RoleGraphService unit-proven (traversal, expansion, cycle-safe); plugin-sharing 59 tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XVdnfUAx85amkerym26vdx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 89 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
June 20, 2026 09:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What (ADR-0056 D6 — configurable role-hierarchy widening)
Role-hierarchy access widening — "a manager sees the records shared with their team" — is now implemented and configurable per sharing rule, not the hardcoded no-op the audit found (
Role.parentwas declared but never consumed by any access decision).Low-code design (your point — it must be configurable): this is Salesforce's "grant access using the role hierarchy" expressed declaratively per rule, not "managers always see everything":
recipient_type: 'role_and_subordinates'(now selectable onsys_sharing_rule+ in theSharingRuleRecipientTypecontract).sys_role.parenthierarchy via a newRoleGraphService(mirrors the existing department/team graphs; cycle-safe; system-context lookups).Verification
RoleGraphServiceunit tests: downward traversal (incl. self), subordinate-user expansion, cycle-safe (A↔B loop terminates), unknown-role → empty.plugin-sharingfull suite 59 tests green; build clean.ADR-0056 status
Done + merged: OWD scenarios (#2062), D4+D8 (#2064), D1+D2 (#2065). D6 here. Next in the program: D7 default Profile (SSO/JIT foundation), D10 conformance-matrix CI (the durable guardrail), and the release-gated
requireAuthdefault flip.🤖 Generated with Claude Code
Generated by Claude Code