Skip to content

Commit

Permalink
Prevent racing conditions when enabling role system
Browse files Browse the repository at this point in the history
Actual application of the roles will only happen once, if role system is
enabled after that, it wont be evaluated, and roles will not apply.

[3.2.x]

ERM 26934

Change-Id: I3d5b605c504d764868585fae44ea48f9f6d64075
  • Loading branch information
it-spiderman committed Feb 15, 2022
1 parent ecc13f0 commit b254586
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Foundation.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function initializeRoleSystem() {
return;
}
$roleManager = $this->services->getService( 'BSRoleManager' );
$roleManager->applyRoles();
$roleManager->enableRoleSystem();
}

}
1 change: 1 addition & 0 deletions src/Permission/RoleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public function isRoleSystemEnabled() {
*/
public function enableRoleSystem() {
$this->roleSystemEnabled = true;
$this->applyRoles();
}

/**
Expand Down

0 comments on commit b254586

Please sign in to comment.