service->getExApp($appId); if ($exApp === null) { return new NotFoundResponse(); } if (!$exApp->getEnabled()) { return new NotFoundResponse(); } $menuEntry = $this->menuEntryService->getExAppMenuEntry($appId, $name); if ($menuEntry === null) { return new NotFoundResponse(); } if (filter_var($menuEntry->getAdminRequired(), FILTER_VALIDATE_BOOLEAN) && !$this->groupManager->isAdmin($this->userId)) { return new NotFoundResponse(); } $initialStates = $this->initialStateService->getExAppInitialStates($appId, 'top_menu', $menuEntry->getName()); foreach ($initialStates as $key => $value) { $this->initialState->provideInitialState($key, $value); } $this->jsProxyMap = $this->scriptsService->applyExAppScripts($appId, 'top_menu', $menuEntry->getName()); $this->stylesService->applyExAppStyles($appId, 'top_menu', $menuEntry->getName()); $this->postprocess = true; $response = new TemplateResponse(Application::APP_ID, 'embedded'); $csp = new ContentSecurityPolicy(); $csp->addAllowedScriptDomain($this->request->getServerHost()); $csp->addAllowedScriptDomain('\'unsafe-eval\''); $csp->addAllowedScriptDomain('\'unsafe-inline\''); $csp->addAllowedFrameDomain($this->request->getServerHost()); $response->setContentSecurityPolicy($csp); return $response; } }