From 866e0eb1628812ff67e75cb8e78d809ed3bfcd3c Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 12 Mar 2021 17:47:16 +1300 Subject: [PATCH] Standardise handling of administer Multiple Organizations --- CRM/Core/Permission.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 4ff3f9210e2a..e7848f9d7460 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -588,13 +588,8 @@ public static function basicPermissions($all = FALSE, $descriptions = FALSE) { */ public static function assembleBasicPermissions($all = FALSE, $descriptions = FALSE) { $config = CRM_Core_Config::singleton(); - $prefix = ts('CiviCRM') . ': '; $permissions = self::getCorePermissions(); - if (self::isMultisiteEnabled()) { - $permissions['administer Multiple Organizations'] = [$prefix . ts('administer Multiple Organizations')]; - } - if (!$descriptions) { foreach ($permissions as $name => $attr) { $permissions[$name] = array_shift($attr); @@ -909,6 +904,14 @@ public static function getCorePermissions() { 'description' => ts('Permit altering all restricted data options'), ], ]; + if (self::isMultisiteEnabled()) { + // This could arguably be moved to the multisite extension but + // within core it does permit editing group-organization records. + $permissions['administer Multiple Organizations'] = [ + 'label' => $prefix . ts('administer Multiple Organizations'), + 'description' => ts('Administer multiple organizations. In practice this allows editing the group organization link') + ]; + } foreach (self::getImpliedPermissions() as $name => $includes) { foreach ($includes as $permission) { $permissions[$name][] = $permissions[$permission];