Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2601 fix joomla permission regression #20267

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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