public function ListenerPageController::access in Evercurrent 8
Same name and namespace in other branches
- 8.2 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:
Return value
\Drupal\Core\Access\AccessResult
1 string reference to 'ListenerPageController::access'
File
- src/
Controller/ ListenerPageController.php, line 27 - Contains \Drupal\example\Controller\ExamleController.
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();
}