public function beforeAction($action) { if (!$this->contentContainer->isAdmin()) { throw new HttpException(403, 'Access denied - Space Administrator only!'); } return parent::beforeAction($action); }
public function beforeAction($action) { if ($this->contentContainer instanceof Space && !$this->contentContainer->isMember()) { throw new HttpException(403, 'You need to be member of this space to this wiki!'); } return parent::beforeAction($action); }
public function init() { $this->virtualRootFolder = new Folder(); $this->virtualRootFolder->id = self::ROOT_ID; $this->virtualRootFolder->title = Yii::t('CfilesModule.base', 'root'); $this->virtualAllPostedFilesFolder = new Folder(); $this->virtualAllPostedFilesFolder->id = self::All_POSTED_FILES_ID; $this->virtualAllPostedFilesFolder->title = Yii::t('CfilesModule.base', 'All posted files'); return parent::init(); }
public function beforeAction($action) { if (!Yii::$app->user->getIdentity()->isModuleEnabled('calendar')) { throw new HttpException('500', 'Calendar module is not enabled for your user!'); } else { if ($this->contentContainer instanceof User && $this->contentContainer->id != Yii::$app->user->id) { throw new HttpException('500', 'Your user is not allowed to access here!'); } else { if ($this->contentContainer instanceof Space && !$this->contentContainer->isAdmin(Yii::$app->user->id)) { throw new HttpException(404, Yii::t('CalendarModule.base', 'You miss the rights to view or modify external sources!')); } } } return parent::beforeAction($action); }
public function beforeAction($action) { $this->adminOnly(); 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(); return $retVal; }