From: Tim Otten Date: Thu, 7 Mar 2013 09:07:19 +0000 (-0500) Subject: CRM-11925 - Call Drupal::filterPermissions when writing to permission-store (rather... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=993c72e0858e2da4f2b90b1d27ee4696cc708981;p=civicrm-core.git CRM-11925 - Call Drupal::filterPermissions when writing to permission-store (rather than during permission-enumeration) --- diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index d9dcd6ffb6..74b25e3caf 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -103,7 +103,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ function upgradePermissions($module) { $config = CRM_Core_Config::singleton(); // Get all permissions defined by the module. - $module_permissions = $config->userPermissionClass->getModulePermissions($module); + $module_permissions = self::filterPermissions($config->userPermissionClass->getModulePermissions($module), $module); // Construct a delete query to remove permissions for this module. $query = db_delete('role_permission') ->condition('permission', "$module|%", 'LIKE') @@ -131,8 +131,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ if (function_exists($fn_name)) { $module_permissions = array(); $fn_name($module_permissions); - - $return_permissions = self::filterPermissions($module_permissions, $module); + $return_permissions = $module_permissions; } return $return_permissions; }