public function ImageFieldFormatter::access in Entity Embed 8
Indicates whether this Entity Embed display can be used.
This method allows base implementations to add general access restrictions that should apply to all extending Entity Embed display plugins.
Parameters
\Drupal\Core\Session\AccountInterface $account: (optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
Overrides FieldFormatterEntityEmbedDisplayBase::access
File
- src/
Plugin/ entity_embed/ EntityEmbedDisplay/ ImageFieldFormatter.php, line 105
Class
- ImageFieldFormatter
- Entity Embed Display reusing image field formatters.
Namespace
Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplayCode
public function access(AccountInterface $account = NULL) {
return parent::access($account)
->andIf($this
->isValidImage());
}