Skip to content

Commit

Permalink
Merge pull request #16671 from eileenmcnaughton/acl
Browse files Browse the repository at this point in the history
[REF] simplify references to civicrm_acl
  • Loading branch information
seamuslee001 authored Mar 16, 2020
2 parents 6c4ccf3 + d340e67 commit 501d220
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions CRM/ACL/BAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@ protected static function getACLs(int $contact_id) {

$rule = new CRM_ACL_BAO_ACL();

$acl = self::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();

$query = " SELECT acl.*
FROM $acl acl
FROM civicrm_acl acl
WHERE acl.entity_table = '$contact'
AND acl.entity_id = $contact_id";

Expand Down Expand Up @@ -232,15 +231,14 @@ protected static function getGroupACLs($contact_id, $aclRoles = FALSE) {

$rule = new CRM_ACL_BAO_ACL();

$acl = self::getTableName();
$c2g = CRM_Contact_BAO_GroupContact::getTableName();
$group = CRM_Contact_BAO_Group::getTableName();
$results = [];

if ($contact_id) {
$query = "
SELECT acl.*
FROM $acl acl
FROM civicrm_acl acl
INNER JOIN $c2g group_contact
ON acl.entity_id = group_contact.group_id
WHERE acl.entity_table = '$group'
Expand Down Expand Up @@ -277,14 +275,13 @@ protected static function getGroupACLRoles($contact_id) {

$rule = new CRM_ACL_BAO_ACL();

$acl = self::getTableName();
$aclRole = 'civicrm_acl_role';

$aclER = CRM_ACL_DAO_EntityRole::getTableName();
$c2g = CRM_Contact_BAO_GroupContact::getTableName();

$query = " SELECT acl.*
FROM $acl acl
FROM civicrm_acl acl
INNER JOIN civicrm_option_group og
ON og.name = 'acl_role'
INNER JOIN civicrm_option_value ov
Expand Down Expand Up @@ -321,7 +318,7 @@ protected static function getGroupACLRoles($contact_id) {

$query = "
SELECT acl.*
FROM $acl acl
FROM civicrm_acl acl
WHERE acl.entity_id IN ( $roles )
AND acl.entity_table = 'civicrm_acl_role'
";
Expand Down

0 comments on commit 501d220

Please sign in to comment.