jsonapi_cross_bundles-8.x-1.0-alpha3/tests/modules/jsonapi_cross_bundles_test/jsonapi_cross_bundles_test.module
tests/modules/jsonapi_cross_bundles_test/jsonapi_cross_bundles_test.module
<?php
/**
* @file
* Contains hook implementations for testing the JSON:API Cross Bundles module.
*/
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Implements hook_jsonapi_ENTITY_TYPE_filter_access() for 'entity_test_with_bundle'.
*/
function jsonapi_cross_bundles_test_jsonapi_entity_test_with_bundle_filter_access(EntityTypeInterface $entity_type, AccountInterface $account) {
return ([
JSONAPI_FILTER_AMONG_ALL => AccessResult::allowedIfHasPermission($account, 'view test entity'),
]);
}
