Why this write is not allowed, or null when it is.
Both sides of the write are checked. A personal side must belong to the caller; a shared side
needs the grant. Checking only the new side would let a user demote a shared item to their own
and take it over; checking only the old side would let them promote their own to everyone.
A scope is read the way the database reads it: a side is personal when its scope is User
after trimming and case-folding. Any side whose scope is not exactly User (Role, Global,
a padded or re-cased value, a blank, an unknown value) counts as shared and needs the grant.
Why this write is not allowed, or null when it is.
Both sides of the write are checked. A personal side must belong to the caller; a shared side needs the grant. Checking only the new side would let a user demote a shared item to their own and take it over; checking only the old side would let them promote their own to everyone.
A scope is read the way the database reads it: a side is personal when its scope is
Userafter trimming and case-folding. Any side whose scope is not exactlyUser(Role,Global, a padded or re-cased value, a blank, an unknown value) counts as shared and needs the grant.