You are here

public function DomainSwitcherBlock::access in Domain Access 8

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

Overrides BlockPluginTrait::access

File

domain/src/Plugin/Block/DomainSwitcherBlock.php, line 21

Class

DomainSwitcherBlock
Provides a block that links to all domains.

Namespace

Drupal\domain\Plugin\Block

Code

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