diff --git a/CHANGELOG.md b/CHANGELOG.md index 822d9a6cc..1736bc153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/system/src/Grav/Common/Flex/Types/Users/UserObject.php b/system/src/Grav/Common/Flex/Types/Users/UserObject.php index b89997ac7..77d49528c 100644 --- a/system/src/Grav/Common/Flex/Types/Users/UserObject.php +++ b/system/src/Grav/Common/Flex/Types/Users/UserObject.php @@ -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; }