From: eileen Date: Fri, 14 Oct 2016 14:24:13 +0000 (+0100) Subject: CRM-12645 fix regression in previous refactor X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=135367a61b21afe17c174851fa0a68fd0d1ddf4a;p=civicrm-core.git CRM-12645 fix regression in previous refactor --- diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index bbdc30ea2c..0112b38a06 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -140,8 +140,8 @@ WHERE contact_id IN ({$contact_id_list}) $contactID = CRM_Core_Session::getLoggedInContactID(); // first: check if contact is trying to view own contact - if ($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact') - || $type == CRM_Core_Permission::EDIT && CRM_Core_Permission::check('edit my contact') + if ($contactID == $id && ($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact') + || $type == CRM_Core_Permission::EDIT && CRM_Core_Permission::check('edit my contact')) ) { return TRUE; }