From 8210399ab45f3bc992536305d9cf8f9c7ada246b Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 14 Oct 2016 16:13:23 +0100 Subject: [PATCH] CRM-12645 remove unused function --- CRM/Contact/BAO/Contact/Permission.php | 40 +------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index 2dfb14ce01..93d0917042 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -165,6 +165,7 @@ WHERE contact_id IN ({$contact_id_list}) return TRUE; } + // We should probably do a cheap check whether it's in the cache first. // check permission based on ACL $tables = array(); $whereTables = array(); @@ -248,45 +249,6 @@ AND ac.user_id IS NULL $_processed[$type][$userID] = 1; } - /** - * Check if there are any contacts in cache table. - * - * @param int|string $type the type of operation (view|edit) - * @param int $contactID - * Contact id. - * - * @return bool - */ - public static function hasContactsInCache( - $type = CRM_Core_Permission::VIEW, - $contactID = NULL - ) { - if (!$contactID) { - $contactID = CRM_Core_Session::getLoggedInContactID(); - } - - if ($type = CRM_Core_Permission::VIEW) { - $operationClause = " operation IN ( 'Edit', 'View' ) "; - $operation = 'View'; - } - else { - $operationClause = " operation = 'Edit' "; - $operation = 'Edit'; - } - - // fill cache - self::cache($contactID); - - $sql = " -SELECT id -FROM civicrm_acl_contact_cache -WHERE user_id = %1 -AND $operationClause LIMIT 1"; - - $params = array(1 => array($contactID, 'Integer')); - return (bool) CRM_Core_DAO::singleValueQuery($sql, $params); - } - /** * @param string $contactAlias * -- 2.25.1