From 8450b663ace6a8770c7821aeacdbaf41c587eb69 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 24 Mar 2021 11:35:04 +1300 Subject: [PATCH] Remove getACLRoles We have cleaned up the code to clarify that 1) it returns an empty array if contact id is set and 2) it is only called with contact_id is set Ergo it does nada Not called from anywhere else (I made it protected last cleanup round) --- CRM/ACL/BAO/ACL.php | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 6f18236709..7c90f24ad8 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -72,38 +72,6 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { return $result; } - /** - * Get all of the ACLs through ACL groups. - * - * @param int $contact_id - * ID of a contact to search for. - * - * @return array - * Array of assoc. arrays of ACL rules - * - * @throws \CRM_Core_Exception - */ - protected static function getACLRoles($contact_id = NULL) { - $contact_id = CRM_Utils_Type::escape($contact_id, 'Integer'); - - $query = 'SELECT acl.* FROM civicrm_acl acl'; - $where = ['acl.entity_table = "civicrm_acl_role" AND acl.entity_id IN (' . implode(',', array_keys(CRM_Core_OptionGroup::values('acl_role'))) . ')']; - - if (!empty($contact_id)) { - return []; - } - - $results = []; - - $rule = CRM_Core_DAO::executeQuery($query . ' WHERE ' . implode(' AND ', $where)); - - while ($rule->fetch()) { - $results[$rule->id] = $rule->toArray(); - } - - return $results; - } - /** * Get all ACLs granted to a contact through all group memberships. * @@ -236,8 +204,6 @@ SELECT acl.* while ($rule->fetch()) { $result[$rule->id] = $rule->toArray(); } - - $result += self::getACLRoles($contact_id); } /* Then, all ACLs granted through group membership */ -- 2.25.1