public function init() { parent::init(); // check permissions $notRestrictedActions = array(); if (!in_array($this->getParam("action"), $notRestrictedActions)) { $this->checkPermission("objects"); } $this->_objectService = new Object\Service($this->getUser()); }
public function init() { parent::init(); // check permissions $notRestrictedActions = array("doc-types"); if (!in_array($this->getParam("action"), $notRestrictedActions)) { $this->checkPermission("documents"); } $this->_documentService = new Document\Service($this->getUser()); }
public function init() { parent::init(); // check permissions $notRestrictedActions = array("get-image-thumbnail", "get-video-thumbnail", "get-document-thumbnail"); if (!in_array($this->getParam("action"), $notRestrictedActions)) { $this->checkPermission("assets"); } $this->_assetService = new Asset\Service($this->getUser()); }
public function preDispatch() { parent::preDispatch(); if ($this->getParam('ctype') === 'document') { $this->element = Document::getById((int) $this->getParam('cid', 0)); } elseif ($this->getParam('ctype') === 'asset') { $this->element = Asset::getById((int) $this->getParam('cid', 0)); } elseif ($this->getParam('ctype') === 'object') { $this->element = ConcreteObject::getById((int) $this->getParam('cid', 0)); } if (!$this->element) { throw new \Exception('Cannot load element' . $this->getParam('cid') . ' of type \'' . $this->getParam('ctype') . '\''); } //get the latest available version of the element - //$this->element = $this->getLatestVersion($this->element); $this->element->setUserModification($this->getUser()->getId()); }