BlockBase::access

public function BlockBase::access

public BlockBase::access(AccountInterface $account, $return_as_object = FALSE)

Indicates whether the block should be shown.

This method allows base implementations to add general access restrictions that should apply to all extending block plugins.

Parameters

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

bool $return_as_object: (optional) Defaults to FALSE.

Return value

bool|\Drupal\Core\Access\AccessResultInterface The access result. Returns a boolean if $return_as