Implement _checkAccess for Contact BAO and related entities (email, phone, etc.)
authorColeman Watts <coleman@civicrm.org>
Wed, 5 May 2021 19:30:03 +0000 (15:30 -0400)
committerTim Otten <totten@civicrm.org>
Mon, 7 Jun 2021 03:18:52 +0000 (20:18 -0700)
commit1d3cbc3c535f826daed52f9e0f976cf0a815b329
treece57f81fe949e67fa5e6b68ba672f8975b12b3a9
parent929a9585fec8683805087f134d6185a0cc84322b
Implement _checkAccess for Contact BAO and related entities (email, phone, etc.)

Implements the _checkAccess BAO callback for contacts and the related entities
listed in _civicrm_api3_check_edit_permissions.

Switch APIv4 to stop using _civicrm_api3_check_edit_permissions
now that the checks are implemented in the BAO.

Also fixes a couple permission check functions to respect $userID variable.
13 files changed:
CRM/Contact/AccessTrait.php [new file with mode: 0644]
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Contact/Permission.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/Email.php
CRM/Core/BAO/IM.php
CRM/Core/BAO/OpenID.php
CRM/Core/BAO/Phone.php
CRM/Core/BAO/Website.php
Civi/Api4/Generic/DAODeleteAction.php
Civi/Api4/Generic/Traits/DAOActionTrait.php
Civi/Api4/Utils/CoreUtil.php
tests/phpunit/api/v3/ContactTest.php