fix race condition on authorization event processing which leads to permission mismatch

This commit is contained in:
Eduard Heimbuch
2020-11-09 16:04:54 +01:00
parent 9930d82d32
commit 121c0d1bf2
3 changed files with 6 additions and 2 deletions

View File

@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Error on repository initialization with least-privilege user ([#1414](https://github.com/scm-manager/scm-manager/pull/1414))
## [2.9.0] - 2020-11-06
### Added
- Tracing api ([#1393](https://github.com/scm-manager/scm-manager/pull/#1393))

View File

@@ -140,7 +140,7 @@ public class AuthorizationChangedEventProducer {
*
* @param event repository event
*/
@Subscribe
@Subscribe(async = false)
public void onEvent(RepositoryEvent event) {
if (event.getEventType().isPost()) {
if (isModificationEvent(event)) {

View File

@@ -295,7 +295,7 @@ public class DefaultAuthorizationCollector implements AuthorizationCollector
//J+
}
@Subscribe
@Subscribe(async = false)
public void invalidateCache(AuthorizationChangedEvent event) {
if (event.isEveryUserAffected()) {
invalidateUserCache(event.getNameOfAffectedUser());