diff --git a/application/controllers/admin/tokens.php b/application/controllers/admin/tokens.php index 4936b4e86d5..f6206fc4c3e 100644 --- a/application/controllers/admin/tokens.php +++ b/application/controllers/admin/tokens.php @@ -1677,7 +1677,7 @@ public function importldap($iSurveyId) $iSurveyId = (int) $iSurveyId; $survey = Survey::model()->findByPk($iSurveyId); $aData = array(); - if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import')) { + if (!(Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import') || Permission::model()->hasGlobalPermission('surveys', 'update'))) { Yii::app()->session['flashmessage'] = gT("You do not have permission to access this page."); $this->getController()->redirect(array("/admin/survey/sa/view/surveyid/{$iSurveyId}")); } @@ -1920,7 +1920,7 @@ public function import($iSurveyId) $aData = array(); $iSurveyId = (int) $iSurveyId; $survey = Survey::model()->findByPk($iSurveyId); - if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import')) { + if (!(Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'import') || Permission::model()->hasGlobalPermission('surveys', 'update'))) { Yii::app()->session['flashmessage'] = gT("You do not have permission to access this page."); $this->getController()->redirect(array("/admin/survey/sa/view/surveyid/{$iSurveyId}")); } diff --git a/application/views/admin/token/token_bar.php b/application/views/admin/token/token_bar.php index 556c8796524..206bc65b5c0 100644 --- a/application/views/admin/token/token_bar.php +++ b/application/views/admin/token/token_bar.php @@ -14,7 +14,7 @@ - hasSurveyPermission($oSurvey->sid, 'tokens', 'read')): ?> + hasSurveyPermission($oSurvey->sid, 'tokens', 'read') || Permission::model()->hasGlobalPermission('surveys', 'update')): ?> @@ -30,7 +30,7 @@