_initCommittee(); $this->_checkAccess(); return parent::exec(); } protected function _initCommittee() { if (!$this->_getDataObj()->initCommitteeData($this->_restAlias)) { $this->_do404(); } $header = '"' . $this->_getDataObj()->getCommitteeData($this->_getDataObj()->getCommitteeId())->toArray()['title'] . '" ' . $this->_doc->getTitle(); $this->_doc->setHeader($header); return $this; } /** * method requires logged in leadership for managing documents of committee * @return AbstractView */ protected function _checkAccess() { $userId = \App_User_Auth::getInstance()->getData('id'); $committeeLeadershipsId = $this->_getDataObj()->getLeadershipIds(); if (!in_array($userId, $committeeLeadershipsId)) { $this->_do404(); } return $this; } }