You are here

protected function BlockContentBlock::blockAccess in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockAccess()
  2. 9 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockAccess()

File

core/modules/block_content/src/Plugin/Block/BlockContentBlock.php, line 175

Class

BlockContentBlock
Defines a generic custom block type.

Namespace

Drupal\block_content\Plugin\Block

Code

protected function blockAccess(AccountInterface $account) {
  if ($this
    ->getEntity()) {
    return $this
      ->getEntity()
      ->access('view', $account, TRUE);
  }
  return AccessResult::forbidden();
}