Skip to content

Commit

Permalink
Merge pull request #19789 from eileenmcnaughton/permc
Browse files Browse the repository at this point in the history
[REF]  getCorePermissions cleanup
  • Loading branch information
colemanw authored Mar 12, 2021
2 parents b6873cd + ce6b4d9 commit 6ebc8f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions CRM/Core/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,7 @@ 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($descriptions);

if (self::isMultisiteEnabled()) {
$permissions['administer Multiple Organizations'] = [$prefix . ts('administer Multiple Organizations')];
}
$permissions = self::getCorePermissions();

if (!$descriptions) {
foreach ($permissions as $name => $attr) {
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion distmaker/utils/joomlaxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function generateJoomlaConfig($version) {
require_once 'CRM/Core/Permission.php';
require_once 'CRM/Utils/String.php';
require_once 'CRM/Core/I18n.php';
$permissions = CRM_Core_Permission::getCorePermissions(TRUE);
$permissions = CRM_Core_Permission::getCorePermissions();

$crmFolderDir = $sourceCheckoutDir . DIRECTORY_SEPARATOR . 'CRM';

Expand Down

0 comments on commit 6ebc8f4

Please sign in to comment.