Skip to content

Commit

Permalink
Dev: Add TODO - redirect in Ajax call??
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jan 30, 2018
1 parent b626854 commit 93f161f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -518,6 +518,7 @@ public function getAjaxMenuArray($surveyid, $position = '')
$iSurveyID = sanitize_int($surveyid);

if (!Permission::model()->hasSurveyPermission($iSurveyID, 'surveysettings', 'read')) {
// TODO: Called by Ajax, no point redirecting?
Yii::app()->user->setFlash('error', gT("Access denied"));
$this->getController()->redirect(Yii::app()->createUrl('/admin'));
}
Expand Down

5 comments on commit 93f161f

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About all this part : i really think we must throw clean 401/404/403 error, and have a clean ajax system to show the error in a box.

@olleharstedt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That's why I did the AjaxHelper before, but Markus chose not to adopt it. It should be removed and replaced by a system Markus wants.

@Shnoulle
Copy link
Collaborator

@Shnoulle Shnoulle commented on 93f161f Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You + me + Louis think it's best to throw clean error, no ? (and use a AjaxHelper)

@olleharstedt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean error, yes, of course, but Markus is responsible for the JavaScript parts of LS right now, so it should be up to him to design a solution.

@olleharstedt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A solution that fits with his other code, I mean.

Please sign in to comment.