You are here

protected static function FieldConfigTest::entityAccess in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/FieldConfigTest.php \Drupal\Tests\jsonapi\Functional\FieldConfigTest::entityAccess()

Checks access for the given operation on the given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which to check field access.

string $operation: The operation for which to check access.

\Drupal\Core\Session\AccountInterface $account: The account for which to check access.

Return value

\Drupal\Core\Access\AccessResultInterface The AccessResult.

Overrides ResourceTestBase::entityAccess

File

tests/src/Functional/FieldConfigTest.php, line 169

Class

FieldConfigTest
JSON API integration test for the "FieldConfig" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected static function entityAccess(EntityInterface $entity, $operation, AccountInterface $account) {

  // Also clear the 'field_storage_config' entity access handler cache because
  // the 'field_config' access handler delegates access to it.
  // @see \Drupal\field\FieldConfigAccessControlHandler::checkAccess()
  \Drupal::entityTypeManager()
    ->getAccessControlHandler('field_storage_config')
    ->resetCache();
  return parent::entityAccess($entity, $operation, $account);
}