function hook_jsonapi_entity_filter_access(\Drupal\Core\Entity\EntityTypeInterface
$entity_type, \Drupal\Core\Session\AccountInterface
$account) { // For every entity type that has an admin permission, allow access to filter
// by all entities of that type to users with that permission.
if ($admin_permission =
$entity_type->
getAdminPermission()) { return ([ JSONAPI_FILTER_AMONG_ALL => AccessResult::
allowedIfHasPermission($account,
$admin_permission),
]);
}}/**
* Controls access to filtering by entity data via JSON:API.
*
* This is the entity-type-specific variant of
* hook_jsonapi_entity_filter_access(). For implementations with logic that is
* specific to a single entity type, it is recommended to implement this hook
* rather than the generic hook_jsonapi_entity_filter_access() hook, which is
* called for every entity type.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type of the entities to be filtered upon.
* @param \Drupal\Core\Session\AccountInterface $account
* The account for which to check access.
*
* @return \Drupal\Core\Access\AccessResultInterface[]
* The array of access results, keyed by subset. See
* hook_jsonapi_entity_filter_access() for details.
*
* @see hook_jsonapi_entity_filter_access()
*/