You are here

public function Domain::access in Domain Access 8

Determine if the current user has access or not.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user who wants to access this view.

Return value

bool Returns whether the user has access to the view.

Overrides AccessPluginBase::access

File

domain/src/Plugin/views/access/Domain.php, line 81

Class

Domain
Access plugin that provides domain-based access control.

Namespace

Drupal\domain\Plugin\views\access

Code

public function access(AccountInterface $account) {
  $id = $this->domainNegotiator
    ->getActiveId();
  $options = array_filter($this->options['domain']);
  return isset($options[$id]);
}