This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.0] fix: grant pending permissions not working correctly#50073
Merged
Conversation
## Description GrantPendingPermissions can be called multiple times in a loop. When using unified perms, it uses a method that by default removed old records from the table, effectively replacing existing records with new records. However this behavior is not correct for granting pending permissions, which should only add new records, not remove old ones. Fixing this allows us to call GrantPendingPermissions in a loop without causing incosistencies in the database. ## Test plan extensively unit tested so that we are sure it works for both legacy and unified permissions (cherry picked from commit d7ca3ca)
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 69d7cbf and 530863b or learn more. Open explanation
|
|
You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab. |
kopancek
approved these changes
Mar 28, 2023
kopancek
left a comment
Contributor
There was a problem hiding this comment.
looks good to me - the same as original PR
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
GrantPendingPermissions can be called multiple times in a loop. When using unified perms, it uses a method that by default removed old records from the table, effectively replacing existing records with new records.
However this behavior is not correct for granting pending permissions, which should only add new records, not remove old ones. Fixing this allows us to call GrantPendingPermissions in a loop without causing incosistencies in the database.
Test plan
extensively unit tested so that we are sure it works for both legacy and unified permissions
Backport d7ca3ca from #50059