From 4ae10b6dc9bde4db4c39682eaeec5127e7412512 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 8 Mar 2013 06:25:56 -0500 Subject: [PATCH] CRM-11925 - Remove uninstallPermissions() upgradePermissions() addresses a superset of cases handled by uninstallPermissions(). --- CRM/Core/Permission/Base.php | 7 ------- CRM/Core/Permission/Drupal.php | 10 ---------- CRM/Core/Permission/Drupal6.php | 9 --------- CRM/Extension/Manager/Module.php | 5 ----- 4 files changed, 31 deletions(-) diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index 653ae99323..3b3a406967 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -163,13 +163,6 @@ class CRM_Core_Permission_Base { return FALSE; } - /** - * Remove all vestiges of permissions for the given module. - */ - function uninstallPermissions($module) { - throw new CRM_Core_Exception("Unimplemented method: CRM_Core_Permission_*::uninstallPermissions"); - } - /** * Ensure that the CMS supports all the permissions defined by CiviCRM * and its extensions. If there are stale permissions, they should be diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index d091426067..60c15c9097 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -91,16 +91,6 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase{ return TRUE; } - /** - * Remove all vestiges of permissions for the given module. - */ - function uninstallPermissions($module) { - db_delete('role_permission') - ->condition('permission', "$module|%", 'LIKE') - ->condition('module', 'civicrm') - ->execute(); - } - /** * {@inheritdoc} */ diff --git a/CRM/Core/Permission/Drupal6.php b/CRM/Core/Permission/Drupal6.php index 63d703b950..8c7d2c26fe 100644 --- a/CRM/Core/Permission/Drupal6.php +++ b/CRM/Core/Permission/Drupal6.php @@ -156,15 +156,6 @@ class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase { return TRUE; } - /** - * Remove all vestiges of permissions for the given module. - * - * Does nothing in Drupal 6. - */ - function uninstallPermissions($module) { - // D6 allows us to be really lazy... things get cleaned up when the admin form is next submitted... - } - /** * {@inheritdoc} * diff --git a/CRM/Extension/Manager/Module.php b/CRM/Extension/Manager/Module.php index 7c2ce4768b..89655eae71 100644 --- a/CRM/Extension/Manager/Module.php +++ b/CRM/Extension/Manager/Module.php @@ -67,11 +67,6 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { } public function onPostUninstall(CRM_Extension_Info $info) { - // Remove references to the module's permissions. - $config = CRM_Core_Config::singleton(); - if ($config->userPermissionClass->isModulePermissionSupported()) { - $config->userPermissionClass->uninstallPermissions($info->file); - } // else: don't care because no permissions were installed! } public function onPreDisable(CRM_Extension_Info $info) { -- 2.25.1