function jsonapi_jsonapi_taxonomy_term_filter_access in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/jsonapi.module \jsonapi_jsonapi_taxonomy_term_filter_access()
- 10 core/modules/jsonapi/jsonapi.module \jsonapi_jsonapi_taxonomy_term_filter_access()
Implements hook_jsonapi_ENTITY_TYPE_filter_access() for 'taxonomy_term'.
File
- core/
modules/ jsonapi/ jsonapi.module, line 298 - Module implementation file.
Code
function jsonapi_jsonapi_taxonomy_term_filter_access(EntityTypeInterface $entity_type, AccountInterface $account) {
// @see \Drupal\taxonomy\TermAccessControlHandler::checkAccess()
return [
JSONAPI_FILTER_AMONG_ALL => AccessResult::allowedIfHasPermission($account, 'administer taxonomy'),
JSONAPI_FILTER_AMONG_PUBLISHED => AccessResult::allowedIfHasPermission($account, 'access content'),
];
}