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.
\Drupal\Core\Session\AccountInterface $account: The user session for which to check access.
\Drupal\Core\Access\AccessResult The access result.
self::access()
protected function blockAccess(AccountInterface $account) { // By default, the block is visible. return AccessResult::allowed(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Block!BlockBase.php/function/BlockBase::blockAccess/8.1.x