You are here

class DomainListCheck in Domain Access 8

Custom access control handler for the domain overview page.

Hierarchy

Expanded class hierarchy of DomainListCheck

File

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

Namespace

Drupal\domain\Access
View source
class DomainListCheck {

  /**
   * Handles route permissions on the domain list page.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account making the route request.
   *
   * @return \Drupal\Core\Access\AccessResult
   *   The access result.
   */
  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();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DomainListCheck::viewDomainList public static function Handles route permissions on the domain list page.