CRM-12060 - Support hook_civicrm_permissions on WordPress
authorvivekarora <vivek11112@gmail.com>
Wed, 9 Oct 2013 17:38:36 +0000 (18:38 +0100)
committervivekarora <vivek11112@gmail.com>
Wed, 9 Oct 2013 17:38:36 +0000 (18:38 +0100)
----------------------------------------
* CRM-12060: Support hook_civicrm_permissions on WordPress
  http://issues.civicrm.org/jira/browse/CRM-12060

CRM/ACL/Form/WordPress/Permissions.php
CRM/Core/Permission/WordPress.php

index 3bc91c66235ee5d920442484f1649ba84a98a6be..8d638890d18404590e611a78859c0dfff2b862cf 100644 (file)
@@ -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) {
index b571cd890d97a699c7025631d554c903a083ec94..38ae1f6085c9e6a21672fd07c8059069361ec46d 100644 (file)
@@ -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;
+  }
 }