You are here

public function DomainTokenBlock::access in Domain Access 8

Overrides \Drupal\block\BlockBase::access().

Overrides BlockPluginTrait::access

File

domain/src/Plugin/Block/DomainTokenBlock.php, line 22

Class

DomainTokenBlock
Provides a token information block for a domain request.

Namespace

Drupal\domain\Plugin\Block

Code

public function access(AccountInterface $account, $return_as_object = FALSE) {
  $access = AccessResult::allowedIfHasPermissions($account, [
    'administer domains',
    'view domain information',
  ], 'OR');
  return $return_as_object ? $access : $access
    ->isAllowed();
}