-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Dev 18809 make set user access atomical #22931
base: 5.2.x-dev
Are you sure you want to change the base?
Conversation
$success = $this->model->updateUserAccessConditionally($userLogin, $idSite, $role, $previousAccess); | ||
if ($success === false) { | ||
throw new Exception('Concurrency problem'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess at this point we would need to remove all capabilities that were set for a specific site, as deleteUserAccess
is no longer called upfront. If there are new capabilities that should be set, that will happen below.
Another possibility is to iterate over each site, check which capabilities are already set and which should be set. And based on a diff remove or add capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgiehl can you elaborate why need to remove all capabilities here, why would new capabilities have to be set if the exception is thrown?
The flows are either:
- Update role fails - capabilities don't get touched.
- Update role is successful - capabilities get updated.
Description:
Please include a description of this change and which issue it fixes. If no issue exists yet please include context and what problem it solves.
Review