Skip to content
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
coury-clark merged 1 commit into
5.0from
backport-50059-to-5.0
Mar 28, 2023
Merged

[Backport 5.0] fix: grant pending permissions not working correctly#50073
coury-clark merged 1 commit into
5.0from
backport-50059-to-5.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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

## 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)
@sg-e2e-regression-test-bob

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
1.65% (+50.90 kb) 🔺 0.02% (+3.08 kb) -0.42% (-47.81 kb) 🔽 -0.14% (-1) 🔽

Look at the Statoscope report for a full comparison between the commits 69d7cbf and 530863b or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@github-advanced-security

Copy link
Copy Markdown

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 kopancek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me - the same as original PR

@coury-clark coury-clark merged commit f1fe4b7 into 5.0 Mar 28, 2023
@coury-clark coury-clark deleted the backport-50059-to-5.0 branch March 28, 2023 20:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants