Skip to content

Commit

Permalink
Fixed issue #10829: Survey admins presented with inappropriate control
Browse files Browse the repository at this point in the history
buttons

Dev: Don't allow to display reorder form if no update permission.
  • Loading branch information
olleharstedt committed Apr 15, 2016
1 parent 65d409f commit 64248d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -1234,7 +1234,13 @@ public function organize($iSurveyID)
$thereIsPostData = $request->getPost('orgdata') !== null;
$userHasPermissionToUpdate = Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'update');

if ($thereIsPostData && $userHasPermissionToUpdate)
if (!$userHasPermissionToUpdate)
{
Yii::app()->user->setFlash('error', gT("Access denied"));
$this->getController()->redirect(Yii::app()->request->urlReferrer);
}

if ($thereIsPostData)
{
// Save the new ordering
$this->_reorderGroup($iSurveyID);
Expand Down

0 comments on commit 64248d5

Please sign in to comment.