You are here

protected function EntityCollectorBlock::blockAccess in Relation 8.2

Same name and namespace in other branches
  1. 8 relation_entity_collector/src/Plugin/Block/EntityCollectorBlock.php \Drupal\relation_entity_collector\Plugin\Block\EntityCollectorBlock::blockAccess()

Indicates whether the block should be shown.

Blocks with specific access checking should override this method rather than access(), in order to avoid repeating the handling of the $return_as_object argument.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user session for which to check access.

Return value

\Drupal\Core\Access\AccessResult The access result.

Overrides BlockPluginTrait::blockAccess

See also

self::access()

File

relation_entity_collector/src/Plugin/Block/EntityCollectorBlock.php, line 27
Contains \Drupal\relation_entity_collector\Plugin\Block\EntityCollectorBlock.

Class

EntityCollectorBlock
Provides a 'Relation entity collector' block.

Namespace

Drupal\relation_entity_collector\Plugin\Block

Code

protected function blockAccess(AccountInterface $account) {
  return $account
    ->hasPermission('administer relations') || $account
    ->hasPermission('create relations');
}