protected function WebformEntityReferenceEntityFormatter::checkAccess in Webform 8.5
Same name and namespace in other branches
- 6.x 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 227
Class
- WebformEntityReferenceEntityFormatter
- Plugin implementation of the 'Webform rendered entity' formatter.
Namespace
Drupal\webform\Plugin\Field\FieldFormatterCode
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();
}