public function TestBlockInstantiation::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 BlockBase::access

See also

hook_block_access()

File

drupal/core/modules/block/tests/lib/Drupal/block_test/Plugin/Block/TestBlockInstantiation.php, line 37
Contains \Drupal\block_test\Plugin\Block\TestBlockInstantiation.

Class

TestBlockInstantiation
Provides a basic block for testing block instantiation and configuration.

Namespace

Drupal\block_test\Plugin\Block

Code

public function access() {
  return user_access('access content');
}