X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FACL%2FAPI.php;h=cff9541c4957c166d20e8a1d0026b43704669e06;hb=91f9379b93bce63d806da94ee0183a930ebac6f6;hp=b3eacfc3f0f0f408e31feb22472a9425bf00cbe6;hpb=7f874ed2330864693882bd7c1400ba43269df7b2;p=civicrm-core.git diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index b3eacfc3f0..cff9541c49 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_ACL_API { @@ -113,18 +113,18 @@ class CRM_ACL_API { } } - // first see if the contact has edit / view all contacts - if (CRM_Core_Permission::check('edit all contacts') || - ($type == self::VIEW && CRM_Core_Permission::check('view all contacts')) - ) { - return $deleteClause; - } - if (!$contactID) { $contactID = CRM_Core_Session::getLoggedInContactID(); } $contactID = (int) $contactID; + // first see if the contact has edit / view all permission + if (CRM_Core_Permission::check('edit all contacts', $contactID) || + ($type == self::VIEW && CRM_Core_Permission::check('view all contacts', $contactID)) + ) { + return $deleteClause; + } + $where = implode(' AND ', array( CRM_ACL_BAO_ACL::whereClause($type,