function AuthorFormatter::checkAccess

Same name and namespace in other branches
  1. 9 core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::checkAccess()
  2. 8.9.x core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::checkAccess()
  3. 10 core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::checkAccess()

Overrides EntityReferenceFormatterBase::checkAccess

File

core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php, line 55

Class

AuthorFormatter
Plugin implementation of the 'author' formatter.

Namespace

Drupal\user\Plugin\Field\FieldFormatter

Code

protected function checkAccess(EntityInterface $entity) {
    return $entity->access('view label', NULL, TRUE);
}

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