Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BlockContentBlock.php

function 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();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal