From 993c72e0858e2da4f2b90b1d27ee4696cc708981 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 7 Mar 2013 04:07:19 -0500 Subject: [PATCH] CRM-11925 - Call Drupal::filterPermissions when writing to permission-store (rather than during permission-enumeration) --- CRM/Core/Permission/Drupal.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } -- 2.25.1