Searchkit relationship permissions (API4)
In a SearchKit with a Relationship involved, it's necessary to have "administer CiviCRM" permissions to get results. Users without this permissions get no results and logs show an error like:
AJAX Error ({error_id}): failed with exception Array ( [error_id] => t464-snEL-Taiu [exception] => Civi\API\Exception\UnauthorizedException: "Authorization failed" #0 /web/sites/all/modules/civicrm/Civi/API/Kernel.php(147): Civi\API\Kernel->authorize(Object(Civi\Api4\Provider\ActionObjectProvider), Object(Civi\Api4\Generic\DAOGetAction)) #1 (closed) /web/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(234): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction)) #2 (closed) /web/sites/all/modules/civicrm/api/api.php(85): Civi\Api4\Generic\AbstractAction->execute() #3 (closed) /web/sites/all/modules/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/Run.php(70): civicrm_api4("RelationshipCache", "get", (Array:11), NULL) #4 /web/sites/all/modules/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php(110): Civi\Api4\Action\SearchDisplay\Run->processResult(Object(Civi\Api4\Result\SearchDisplayRunResult)) #5 /web/sites/all/modules/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Action\SearchDisplay\AbstractRunAction->_run(Object(Civi\Api4\Result\SearchDisplayRunResult)) #6 (closed) /web/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\SearchDisplay\Run)) #7 (closed) /web/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(234): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\SearchDisplay\Run)) #8 (closed) /web/sites/all/modules/civicrm/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php(83): Civi\Api4\Generic\AbstractAction->execute() #9 (closed) /web/sites/all/modules/civicrm/api/api.php(85): Civi\Api4\Action\SearchDisplay\AbstractRunAction->execute() #10 (closed) /web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(136): civicrm_api4("SearchDisplay", "run", (Array:9), NULL) #11 (closed) /web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(67): CRM_Api4_Page_AJAX->execute("SearchDisplay", "run", (Array:9)) #12 (closed) /web/sites/all/modules/civicrm/CRM/Core/Invoke.php(319): CRM_Api4_Page_AJAX->run((Array:3), NULL) #13 /web/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3)) #15 (closed) /web/sites/all/modules/civicrm/drupal/civicrm.module(471): CRM_Core_Invoke::invoke((Array:3)) #16 (closed) /web/includes/menu.inc(527): civicrm_invoke("ajax", "api4") #17 (closed) /web/index.php(21): menu_execute_active_handler() #18 (closed) {main} )