docs(adr): ADR-0057 addendum — finish D4's reverse role→users path (sys_member.role → sys_user_role)#2326
Merged
Merged
Conversation
… sys_member.role The role→users expansion (approvals expandRoleUsers, sharing teamGraph.expandRoleUsers) terminates in sys_member.role and never unions sys_user_role, contradicting D4's source-of-truth model on the reverse direction. Document it as an incomplete/phased migration (not intentional design, not an approvals-only bug — plugin-sharing, an in-scope consumer, behaves identically), with the follow-up decision to finish the union in both plugins and the type:'field'+mapping workaround until then.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Appends an addendum to ADR-0057 recording a follow-up gap found while adjudicating an approval-routing question.
D4 made
sys_user_rolethe source of truth for RBAC role assignment and migrated the forward direction (given a user → which roles, intoctx.roles = sys_user_role ∪ sys_member.role). The reverse direction (given a role → which users) was not migrated:plugin-approvalsexpandRoleUsers(approval-service.ts:380-389) →find('sys_member', { filter: { role } })plugin-sharingteamGraph.expandRoleUsers(team-graph.ts:70-80) →find('sys_member', …)Neither unions
sys_user_role.Why this framing
plugin-sharingbehaves identically.Consequence
A user holding a role only via
sys_user_role(never written tosys_member.role) is invisible to approval routing and sharing-rule role expansion.Follow-up decision (documented, does not revise D4)
sys_user_role ∪ sys_member.roleon the reverse path, in both plugins, scoped byorganization_id.sys_member.rolefrom forward and reverse paths together when the transition window closes.type:'field'approvers fed by a submit-time 岗位→人 mapping.Doc-only change. Implementation + regression test (a
sys_user_role-only assignee must resolve) tracked as follow-up.