You are here

public static function DomainListCheck::viewDomainList in Domain Access 8

Handles route permissions on the domain list page.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account making the route request.

Return value

\Drupal\Core\Access\AccessResult The access result.

1 string reference to 'DomainListCheck::viewDomainList'
domain.routing.yml in domain/domain.routing.yml
domain/domain.routing.yml

File

domain/src/Access/DomainListCheck.php, line 22

Class

DomainListCheck
Custom access control handler for the domain overview page.

Namespace

Drupal\domain\Access

Code

public static function viewDomainList(AccountInterface $account) {
  if ($account
    ->hasPermission('administer domains') || $account
    ->hasPermission('view domain list') || $account
    ->hasPermission('view assigned domains')) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}