/**
  * @param GetResponseForControllerResultEvent $event
  */
 public function onKernelView(GetResponseForControllerResultEvent $event)
 {
     $_route = $event->getRequest()->attributes->get('_route');
     if ('oro_shortcut_actionslist' == $_route) {
         $controllerResult = $event->getControllerResult();
         foreach ($controllerResult['actionsList'] as $route => $data) {
             if (!$this->whitelistProvider->isItemWhitelisted($route)) {
                 unset($controllerResult['actionsList'][$route]);
             }
         }
         $event->setControllerResult($controllerResult);
     }
 }
 /**
  * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     $route = $request->attributes->get('_route');
     if (empty($route)) {
         $route = $request->attributes->get('_master_request_route');
     }
     if (!$this->provider->isItemWhitelisted($route)) {
         $notFoundException = new NotFoundHttpException('Sorry, the page that you requested was not found.');
         $statusCode = $notFoundException->getStatusCode();
         $parameters = ['status_code' => $statusCode, 'status_text' => Response::$statusTexts[$statusCode], 'currentContent' => '', 'exception' => FlattenException::create($notFoundException), 'logger' => $this->logger];
         $view = View::create($parameters);
         $view->setFormat(self::VIEW_FORMAT);
         $view->setTemplate($this->findTemplate($request, $statusCode, $this->kernel->isDebug()));
         $response = $this->viewHandler->handle($view);
         $event->setResponse($response);
     }
 }