BlockBase::blockAccess

protected BlockBase::blockAccess(AccountInterface $account)

Indicates whether the block should be shown.

Blocks with specific access checking should override this method rather than access(), in order to avoid repeating the handling of the $return_as_object argument.

Parameters

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

Return value

\Drupal\Core\Access\AccessResult The access result.

See also

self::access()

File

core/lib/Drupal/Core/Block/BlockBase.php, line 138

Class

BlockBase
Defines a base block implementation that most blocks plugins will extend.

Namespace

Drupal\Core\Block

Code

protected function blockAccess(AccountInterface $account) {
  // By default, the block is visible.
  return AccessResult::allowed();
}
doc_Drupal
2016-10-29 08:46:35
Comments
Leave a Comment

Please login to continue.