diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index 60ffbe3c9ed6..c0ac7fcf7447 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -393,15 +393,13 @@ public function getModulePermissions($module): array { * in all enabled CiviCRM module extensions. * * @param bool $descriptions - * @param array $permissions * * @return array * Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions(). */ - public function getAllModulePermissions($descriptions = FALSE, &$permissions): array { - $newPermissions = []; - CRM_Utils_Hook::permission($newPermissions, $permissions); - $permissions = array_merge($permissions, $newPermissions); + public function getAllModulePermissions($descriptions = FALSE): array { + $permissions = []; + CRM_Utils_Hook::permission($permissions); if ($descriptions) { foreach ($permissions as $permission => $label) { diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index dc54996f1423..045a9bf25b15 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -2025,16 +2025,12 @@ public static function cron($jobManager) { * * @param array $newPermissions * Array to be filled with permissions. - * @param array $permissions - * Already calculated permissions. These can be altered. Notably an - * extension might want to add it's permissions to 'implied' or to - * remove some permissions. * * @return null * The return value is ignored */ - public static function permission(&$newPermissions, &$permissions) { - return self::singleton()->invoke(['permissions', 'all_permissions'], $newPermissions, $permissions, + public static function permission(&$newPermissions) { + return self::singleton()->invoke(['permissions'], $newPermissions, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_permission' );