diff --git a/application/controllers/ThemeOptionsController.php b/application/controllers/ThemeOptionsController.php index 0e42719684a..90f6dac0714 100644 --- a/application/controllers/ThemeOptionsController.php +++ b/application/controllers/ThemeOptionsController.php @@ -367,8 +367,8 @@ public function actionUpdateSurveyGroup(int $id = null, int $gsid, $l = null) if (empty($gsid)) { throw new CHttpException(403, gT("You do not have permission to access this page.")); } - $oSurveysInGroup = SurveysInGroup::model()->findByPk($gsid); - if (empty($oSurveysInGroup) && !$oSurveysInGroup->hasPermission('surveys', 'update')) { + $oSurveysGroups = SurveysGroups::model()->findByPk($gsid); + if (empty($oSurveysGroups) || !$oSurveysGroups->hasPermission('surveysettings', 'update')) { throw new CHttpException(403, gT("You do not have permission to access this page.")); } } @@ -623,8 +623,8 @@ public function actionReset(int $gsid) if (empty($gsid)) { throw new CHttpException(403, gT("You do not have permission to access this page.")); } - $oSurveysInGroup = SurveysInGroup::model()->findByPk($gsid); - if (empty($oSurveysInGroup) && !$oSurveysInGroup->hasPermission('surveys', 'update')) { + $oSurveysGroups = SurveysGroups::model()->findByPk($gsid); + if (empty($oSurveysGroups) || !$oSurveysGroups->hasPermission('surveysettings', 'update')) { throw new CHttpException(403, gT("You do not have permission to access this page.")); } }