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
{{ message }}
Repository navigation
Commit 6d46619
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-sharing): watch sys_user_position and sys_team_member only
The membership-role transition source stays part of the holder check (a
user who still holds the position there keeps the grants), but its writes
are not watched: its values are the closed set of membership grades.
Claude-Session: https://claude.ai/code/session_01KqkTQNLcxVc588eZpJmp1r
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/sharing-membership-recompute.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ fix(plugin-sharing): position- and team-recipient sharing rules are re-evaluated
6
6
7
7
Clause-②: no
8
8
9
-
A sharing rule's grants are materialised per user. When a position assignment (`sys_user_position`), a membership role (`sys_member.role`, the position transition source) or a team membership (`sys_team_member`) is inserted, deleted, or updated in a column the recipient expansion reads (the user, the position or team, the organization, the validity window), every sharing rule whose recipient the row names is now re-evaluated for the user the row names, before the write returns. A new holder gains the rule's grants and a former holder loses them. Other users' grants, and rules naming other recipients, are not touched.
9
+
A sharing rule's grants are materialised per user. When a position assignment (`sys_user_position`) or a team membership (`sys_team_member`) is inserted, deleted, or updated in a column the recipient expansion reads (the user, the position or team, the organization, the validity window), every sharing rule whose recipient the row names is now re-evaluated for the user the row names, before the write returns. A new holder gains the rule's grants and a former holder loses them. Other users' grants, and rules naming other recipients, are not touched.
10
10
11
11
The re-evaluation is scoped to that one user and to the rules naming the recipient: an indexed holder check, that user's grants of the rule, and the rule's criteria read only when the rule reaches the user. A bulk assignment import therefore costs one user-scoped pass per row and never a whole-rule pass. An organization's rule is re-evaluated only for rows of its own organization; a platform-global rule for every row.
Copy file name to clipboardExpand all lines: content/docs/permissions/sharing-rules.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,7 +220,7 @@ be an explicit act, and it happens at **five** moments:
220
220
|**Thewritethatdeactivatesoreditstherule**|Thatrule's grants, immediately — deactivating with `active: false` (or `POST {basePath}/sharing/rules` with the same name) revokes them before the call returns |
221
221
|**Thenextinsert/updateofamatchingrecord**|Thatrecord's grants for every rule on the object — an inactive rule desires nothing, so its rows are revoked |
|**A`sys_user_position`, `sys_member`or`sys_team_member`write**|Thegrantsofruleswhoserecipientisthepositionorteamtherownames (`sys_member.role`isthepositiontransitionsource), re-evaluatedfortheusertherownames — inserts, deletes, andupdatestotheuser, therecipient, theorganizationorthevaliditywindow. Anewholdergainstherule's grants and a former holder loses them **before the write returns**; other users'grantsandrulesnamingotherrecipientsarenottouched|
223
+
|**A`sys_user_position`or`sys_team_member`write**|Thegrantsofruleswhoserecipientisthepositionorteamtherownames, re-evaluatedfortheusertherownames — inserts, deletes, andupdatestotheuser, therecipient, theorganizationorthevaliditywindow. Anewholdergainstherule's grants and a former holder loses them **before the write returns**; other users'grantsandrulesnamingotherrecipientsarenottouched|
0 commit comments