/** * Get available Workflows for a document. * * @param Request $request * @param string $subject * * @return Response * * @throws AccessDeniedException If getting workflows for this document is * not allowed by the access checker. */ public function workflowsAction(Request $request, $subject) { if (!$this->accessChecker->check($request)) { throw new AccessDeniedException(); } $result = $this->restHandler->getWorkflows($subject); $view = View::create($result)->setFormat('json'); return $this->viewHandler->handle($view, $request); }
/** * Render javascript HTML tags for create.js and dependencies and bootstrap * javscript code. * * This bundle comes with templates for ckeditor, hallo and to develop on * the hallo coffeescript files. * * To use a different editor simply create a template following the naming * below: * CmfCreateBundle::includejsfiles-%editor%.html.twig * and pass the appropriate editor name. * * @param Request $request The request object for the AccessChecker. * @param string $editor the name of the editor to load. */ public function includeJSFilesAction(Request $request, $editor = 'ckeditor') { if (!$this->accessChecker->check($request)) { return new Response(''); } $view = new View(); $view->setTemplate(sprintf('CmfCreateBundle::includejsfiles-%s.html.twig', $editor)); if ($this->browserFileHelper) { $helper = $this->browserFileHelper->getEditorHelper($editor); $browseUrl = $helper ? $helper->getUrl() : false; } else { $browseUrl = false; } $view->setData(array('cmfCreateEditor' => $editor, 'cmfCreateStanbolUrl' => $this->stanbolUrl, 'cmfCreateImageUploadEnabled' => (bool) $this->imageUploadEnabled, 'cmfCreateFixedToolbar' => (bool) $this->fixedToolbar, 'cmfCreatePlainTextTypes' => json_encode($this->plainTextTypes), 'cmfCreateEditorBasePath' => $this->editorBasePath, 'cmfCreateBrowseUrl' => $browseUrl)); return $this->viewHandler->handle($view); }
protected function checkSecurityUpload(Request $request) { if (!$this->accessChecker->check($request)) { throw new AccessDeniedException(); } }