Closed skyslasher closed 4 years ago
API-Version is 4.4.3, CiviCRM is 5.17.4
Sample Code:
$fields = \Civi\Api4\Contact::getFields() ->setLoadOptions( true ) ->setSelect( [ 'options', 'name' ] ) ->addWhere( 'name', 'IN', $options ) ->setCheckPermissions( false ) ->execute();
Same result on setCheckPermissions set to false or true.
Yes, seeing this here too, with or without setCheckPermissions(). Civi 5.13.5, API version 4.4.3, and latest WordPress.
@skyslasher that's not good. I wonder if you'd be able to upgrade to CiviCRM 5.18 + API 4.5.2 and try again?
Can confirm this is solved by updating to Civi 5.19.
Hooray!
Can confirm it works with API 4.4.3 on Civi 5.19.1. Thanks!
When using \Civi\Api4\Contact::getFields() or \Civi\Api4\Contact::get() on a WordPress page accessed by an anonymous (not loggend in) user, the call fails with "Authorization failed". Using the same call with API3 succeeds. Only when granting "Perform all tasks in the Administer CiviCRM control panel and Import Contacts" the API4 call succeeds.