Improve ProtectedRefAccess#type logic
What does this MR do and why?
Related to branchRuleUpdate mutation bug - unexpected Acc... (#461213 - closed)
Improve ProtectedRefAccess#type logic
Prior to this change we only checked if user or group was present. This is not sufficient to ensure the correct type is returned. If a ProtectedRefAccess level has a user_id or group_id assigned and the user or group is not loaded (or doesn't exist) then :role would be returned incorrectly.
This change checks both user_id and user, and group_id and group when inferring the type.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.