Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent concurrent changes on user permissions #22959

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Jan 21, 2025

Description:

Currently it can happen that two concurrent requests may try to update the permission of the same user.
Depending on how the requests are processed this can end up in a more or less undefined state, where some permissions or capabilities from any requests might be set or not.

To ensure that requests cannot mess up results of each other this PR introduces the use of a concurrency lock for all API methods that change user permission. This has the effect that each request will be processed completely before another request may try to perform its changes. This ensures that after processing a certain request the resulting state is as expected. Even though it might be changed by another request again straight after.

replaces #22957 and #22931

Review

@sgiehl sgiehl added the Needs Review PRs that need a code review label Jan 21, 2025
@sgiehl sgiehl added this to the 5.3.0 milestone Jan 21, 2025
@sgiehl sgiehl requested a review from caddoo January 21, 2025 12:32
@sgiehl sgiehl force-pushed the dev-18809-use-lock branch from a820a45 to dcf79b4 Compare January 22, 2025 14:38
@sgiehl sgiehl merged commit 815c37e into 5.x-dev Jan 22, 2025
23 of 26 checks passed
@sgiehl sgiehl deleted the dev-18809-use-lock branch January 22, 2025 19:57
sgiehl added a commit that referenced this pull request Jan 22, 2025
* Prevent concurrent changes on user permissions

* Esnrue not to work with cached permissions when checking them
caddoo pushed a commit that referenced this pull request Jan 22, 2025
* Prevent concurrent changes on user permissions

* Esnrue not to work with cached permissions when checking them
sgiehl added a commit that referenced this pull request Jan 23, 2025
* Prevent concurrent changes on user permissions

* Esnrue not to work with cached permissions when checking them
valentinab25 pushed a commit to valentinab25/matomo that referenced this pull request Jan 27, 2025
* Prevent concurrent changes on user permissions

* Esnrue not to work with cached permissions when checking them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants