You are here

public function BlockPluginTrait::access in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::access()
  2. 10 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::access()

File

core/lib/Drupal/Core/Block/BlockPluginTrait.php, line 119

Class

BlockPluginTrait
Provides the base implementation of a block plugin.

Namespace

Drupal\Core\Block

Code

public function access(AccountInterface $account, $return_as_object = FALSE) {
  $access = $this
    ->blockAccess($account);
  return $return_as_object ? $access : $access
    ->isAllowed();
}