function FieldConfigTest::entityAccess

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php \Drupal\Tests\jsonapi\Functional\FieldConfigTest::entityAccess()
  2. 10 core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php \Drupal\Tests\jsonapi\Functional\FieldConfigTest::entityAccess()
  3. 11.x core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php \Drupal\Tests\jsonapi\Functional\FieldConfigTest::entityAccess()

Overrides ResourceTestBase::entityAccess

File

core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php, line 174

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.