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 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); }