You are here

public function ListenerPageController::access in Evercurrent 8.2

Same name and namespace in other branches
  1. 8 src/Controller/ListenerPageController.php \Drupal\evercurrent\Controller\ListenerPageController::access()

Check for page access. Only if listening is set to true.

Parameters

\Drupal\Core\Session\AccountInterface $account: Current User account.

Return value

\Drupal\Core\Access\AccessResult Access result fo rthis controller.

1 string reference to 'ListenerPageController::access'
evercurrent.routing.yml in ./evercurrent.routing.yml
evercurrent.routing.yml

File

src/Controller/ListenerPageController.php, line 23

Class

ListenerPageController
Creates a callback for listening to the server.

Namespace

Drupal\evercurrent\Controller

Code

public function access(AccountInterface $account) {
  $config = \Drupal::config('evercurrent.admin_config');
  $listen = $config
    ->get('listen');
  return $listen ? AccessResult::allowed() : AccessResult::forbidden();
}