public function beforeAction($action) { if (!$this->getSpace()->isAdmin()) { throw new CHttpException(403, 'Access denied - Space Administrator only!'); } return parent::beforeAction($action); }
/** * Automatically loads the underlying contentContainer (User/Space) by using * the uguid/sguid request parameter * * @return boolean */ public function init() { $retVal = parent::init(); $this->accessLevel = $this->getAccessLevel(); $this->guidParamName = $this->getGuidParamName(); $this->libraryUrl = $this->getLibraryUrl(); $this->modulesUrl = $this->getModulesUrl(); return $retVal; }
public function beforeAction($action) { $this->checkContainerAccess(); $this->hideSidebar = true; $assetPrefix = Yii::app()->assetManager->publish(dirname(__FILE__) . '/../assets', true, 0, defined('YII_DEBUG')); Yii::app()->clientScript->registerCssFile($assetPrefix . '/wiki.css'); if ($this->contentContainer instanceof Space && !$this->contentContainer->isMember()) { throw new CHttpException(403, 'You need to be member of this space to this wiki!'); } return parent::beforeAction($action); }
public function init() { /** * Fallback for older versions */ if (Yii::app()->request->getParam('containerClass') == 'Space') { $_GET['sguid'] = Yii::app()->request->getParam('containerGuid'); } elseif (Yii::app()->request->getParam('containerClass') == 'User') { $_GET['uguid'] = Yii::app()->request->getParam('containerGuid'); } return parent::init(); }