Fixed UserObject::$authorizeCallable binding to the user object

This commit is contained in:
Matias Griese 2021-12-15 18:00:27 +02:00
parent 484a41e42a
commit a4beb9b8bd
2 changed files with 3 additions and 2 deletions

View File

@ -17,6 +17,7 @@
* Block `.json` files in web server configs
* Disabled pretty debug info for Flex as it slows down Twig rendering
* Fixed Twig being very slow when template overrides do not exist
* Fixed `UserObject::$authorizeCallable` binding to the user object
# v1.7.25
## 11/16/2021

View File

@ -284,8 +284,8 @@ class UserObject extends FlexObject implements UserInterface, Countable
// Check custom application access.
$authorizeCallable = static::$authorizeCallable;
if ($authorizeCallable instanceof Closure) {
$authorizeCallable->bindTo($this);
$authorized = $authorizeCallable($action, $scope);
$callable = $authorizeCallable->bindTo($this, $this);
$authorized = $callable($action, $scope);
if (is_bool($authorized)) {
return $authorized;
}