You are here

protected function WebformEntityReferenceEntityFormatter::checkAccess in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/Field/FieldFormatter/WebformEntityReferenceEntityFormatter.php \Drupal\webform\Plugin\Field\FieldFormatter\WebformEntityReferenceEntityFormatter::checkAccess()

Checks access to the given entity.

By default, entity 'view' access is checked. However, a subclass can choose to exclude certain items from entity access checking by immediately granting access.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check.

Return value

\Drupal\Core\Access\AccessResult A cacheable access result.

Overrides EntityReferenceFormatterBase::checkAccess

File

src/Plugin/Field/FieldFormatter/WebformEntityReferenceEntityFormatter.php, line 172

Class

WebformEntityReferenceEntityFormatter
Plugin implementation of the 'Webform rendered entity' formatter.

Namespace

Drupal\webform\Plugin\Field\FieldFormatter

Code

protected function checkAccess(EntityInterface $entity) {

  // Always allow access so that the Webform element can determine if the
  // Webform is accessible or an access denied message should be displayed.
  // @see \Drupal\webform\Element\Webform
  return AccessResult::allowed();
}