+ public static function create(array $params, Civi\Api4\Generic\AbstractAction $action) {
+ if ($action->getCheckPermissions()) {
+ $allowed = civicrm_api4($params['entity_type'], 'checkAccess', [
+ 'action' => 'get',
+ 'values' => ['id' => $params['entity_id']],
+ ], 0);
+ if (empty($allowed['access'])) {
+ return [];
+ }
+ }