Merge pull request #399 from agh1/batch-countrystatecounty-4.3
[civicrm-core.git] / CRM / Core / Permission.php
index 4fd201a112e5f656f8989a1d05b97b4e07519116..cce8ca720053592d7a8642e803d817fce7a533dc 100644 (file)
@@ -77,6 +77,21 @@ class CRM_Core_Permission {
     return $config->userPermissionClass->check( $str );
   }
 
+  /**
+   * Determine if any one of the permissions strings applies to current user
+   *
+   * @param array $perms
+   * @return bool
+   */
+  public static function checkAnyPerm($perms) {
+    foreach ($perms as $perm) {
+      if (CRM_Core_Permission::check($perm)) {
+        return TRUE;
+      }
+    }
+    return FALSE;
+  }
+
   /**
    * Given a group/role array, check for access requirements
    *
@@ -485,15 +500,6 @@ class CRM_Core_Permission {
     $session = CRM_Core_Session::singleton();
     $contactID = $session->get('userID');
 
-    if (self::isMultisiteEnabled()) {
-      // For multisite just check if there are contacts in acl_contact_cache table for now.
-      // FixMe: so even if a user in multisite has very limited permission could still
-      // see search / contact navigation options for example.
-      return CRM_Contact_BAO_Contact_Permission::hasContactsInCache(CRM_Core_Permission::VIEW,
-        $contactID
-      );
-    }
-
     //check for acl.
     $aclPermission = self::getPermission();
     if (in_array($aclPermission, array(