From 73950aa0ee61a790f4ff77a1370c61cdb41c1630 Mon Sep 17 00:00:00 2001 From: vivekarora Date: Wed, 9 Oct 2013 18:38:36 +0100 Subject: [PATCH] CRM-12060 - Support hook_civicrm_permissions on WordPress ---------------------------------------- * CRM-12060: Support hook_civicrm_permissions on WordPress http://issues.civicrm.org/jira/browse/CRM-12060 --- CRM/ACL/Form/WordPress/Permissions.php | 14 +------------- CRM/Core/Permission/WordPress.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CRM/ACL/Form/WordPress/Permissions.php b/CRM/ACL/Form/WordPress/Permissions.php index 3bc91c6623..8d638890d1 100644 --- a/CRM/ACL/Form/WordPress/Permissions.php +++ b/CRM/ACL/Form/WordPress/Permissions.php @@ -159,19 +159,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form { static function getPermissionArray(){ global $civicrm_root; - $permissions = CRM_Core_Permission::getCorePermissions(); - $crmFolderDir = $civicrm_root . DIRECTORY_SEPARATOR . 'CRM'; - - $components = CRM_Core_Component::getComponentsFromFile($crmFolderDir); - foreach ($components as $comp) { - $perm = $comp->getPermissions(); - if ($perm) { - $info = $comp->getInfo(); - foreach ($perm as $p) { - $permissions[$p] = $info['translatedName'] . ': ' . $p; - } - } - } + $permissions = CRM_Core_Permission::basicPermissions(); $perms_array = array(); foreach ($permissions as $perm => $title) { diff --git a/CRM/Core/Permission/WordPress.php b/CRM/Core/Permission/WordPress.php index b571cd890d..38ae1f6085 100644 --- a/CRM/Core/Permission/WordPress.php +++ b/CRM/Core/Permission/WordPress.php @@ -87,4 +87,17 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { } return FALSE; } + /** + * {@inheritDoc} + */ + public function isModulePermissionSupported() { + return TRUE; + } + + /** + * {@inheritdoc} + */ + function upgradePermissions($permissions) { + return; + } } -- 2.25.1