function BlockContentBlock::blockAccess

Same name in other branches
  1. 9 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockAccess()
  2. 8.9.x core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockAccess()
  3. 11.x core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::blockAccess()

Overrides BlockPluginTrait::blockAccess

File

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

Class

BlockContentBlock
Defines a generic 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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.