Automatic permission calculation on PermissibleBase construction

thanks to the PermissibleInternal/PermissibleBase architectural change, there's no longer any concern regarding cyclic refs.
This commit is contained in:
Dylan K. Taylor
2021-06-26 22:15:22 +01:00
parent 02fab77e55
commit ede4d58394
3 changed files with 1 additions and 6 deletions

View File

@@ -64,10 +64,8 @@ class PermissibleInternal implements Permissible{
public function __construct(array $basePermissions){
$this->permissionRecalculationCallbacks = new ObjectSet();
//TODO: we can't setBasePermission here directly due to bad architecture that causes recalculatePermissions to explode
//so, this hack has to be done here to prevent permission recalculations until it's fixed...
$this->rootPermissions = $basePermissions;
//TODO: permissions need to be recalculated here, or inherited permissions won't work
$this->recalculatePermissions();
}
public function setBasePermission($name, bool $grant) : void{