Skip to content

Commit

Permalink
Merge pull request #20256 from eileenmcnaughton/538
Browse files Browse the repository at this point in the history
dev/core#2601 fix joomla permission regression
  • Loading branch information
seamuslee001 authored May 10, 2021
2 parents ab70282 + 34f4769 commit f173f64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 3 additions & 5 deletions CRM/Core/Permission/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 2 additions & 6 deletions CRM/Utils/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand Down

0 comments on commit f173f64

Please sign in to comment.