You are here

public function DomainNavBlock::access in Domain Access 8

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

Overrides BlockPluginTrait::access

File

domain/src/Plugin/Block/DomainNavBlock.php, line 95

Class

DomainNavBlock
Provides a block that links to all active domains.

Namespace

Drupal\domain\Plugin\Block

Code

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