exempt example


  public function onKernelRequestMaintenance(RequestEvent $event) {
    $request = $event->getRequest();
    $route_match = RouteMatch::createFromRequest($request);
    if ($this->maintenanceMode->applies($route_match)) {
      // Don't cache maintenance mode pages.       \Drupal::service('page_cache_kill_switch')->trigger();

      if (!$this->maintenanceMode->exempt($this->account)) {
        // When the account is not exempt, other subscribers handle request.         $this->eventDispatcher->dispatch($event, MaintenanceModeEvents::MAINTENANCE_MODE_REQUEST);
      }
      else {
        // Display a message if the logged-in user has access to the site in         // maintenance mode. Don't show maintenance message:         // - on AJAX requests.         // - on Iframe uploads.         // - on the maintenance mode settings page.         if ($route_match->getRouteName() != 'system.site_maintenance_mode') {
          $show_message = $route_match->getRouteName() != 'system.site_maintenance_mode' &&
            !
Home | Imprint | This part of the site doesn't use cookies.