public function ListenerPageController::access in Evercurrent 8.2
Same name and namespace in other branches
- 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'
File
- src/
Controller/ ListenerPageController.php, line 23
Class
- ListenerPageController
- Creates a callback for listening to the server.
Namespace
Drupal\evercurrent\ControllerCode
public function access(AccountInterface $account) {
$config = \Drupal::config('evercurrent.admin_config');
$listen = $config
->get('listen');
return $listen ? AccessResult::allowed() : AccessResult::forbidden();
}