public function BlockBase::access

Indicates whether block-specific criteria allow access to the block.

Blocks with access restrictions that should always be applied, regardless of user-configured settings, should implement this method with that access control logic.

Return value

bool FALSE to deny access to the block, or TRUE to allow access.

Overrides BlockPluginInterface::access

See also

hook_block_access()

16 methods override BlockBase::access()
AggregatorCategoryBlock::access in drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
Overrides \Drupal\block\BlockBase::access().
AggregatorFeedBlock::access in drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
Overrides \Drupal\block\BlockBase::access().
ForumBlockBase::access in drupal/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php
Overrides \Drupal\block\BlockBase::access().
LanguageBlock::access in drupal/core/modules/language/lib/Drupal/language/Plugin/Block/LanguageBlock.php
Overrides \Drupal\block\BlockBase::access().
RecentCommentsBlock::access in drupal/core/modules/comment/lib/Drupal/comment/Plugin/Block/RecentCommentsBlock.php
Overrides \Drupal\block\BlockBase::access().

... See full list

File

drupal/core/modules/block/lib/Drupal/block/BlockBase.php, line 97
Contains \Drupal\block\BlockBase.

Class

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

Namespace

Drupal\block

Code

public function access() {

  // By default, the block is visible unless user-configured rules indicate
  // that it should be hidden.
  return TRUE;
}