CRM-19934 improvement on acl cache.
authoreileen <emcnaughton@wikimedia.org>
Thu, 9 Feb 2017 01:44:41 +0000 (14:44 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 9 Feb 2017 01:44:41 +0000 (14:44 +1300)
This change means that when we are checking the allow function we do not add the harmful
OR to the query.

The 'view my contact' & 'edit my contact' permissions have already been checked for.

Adding them into the ACL query with an OR causes serious performance issues, as
elsewhere commented. We can & should avoid it here

CRM/Contact/BAO/Contact/Permission.php

index 3948de9dd8b9625f67096a6133370fad596f93eb..a37e40e7f8bc9a200a2c2c5a08cf79f313560ad3 100644 (file)
@@ -170,7 +170,7 @@ WHERE contact_id IN ({$contact_id_list})
     $tables = array();
     $whereTables = array();
 
-    $permission = CRM_ACL_API::whereClause($type, $tables, $whereTables);
+    $permission = CRM_ACL_API::whereClause($type, $tables, $whereTables, NULL, FALSE, FALSE, TRUE);
     $from = CRM_Contact_BAO_Query::fromClause($whereTables);
 
     $query = "