diff --git a/controllers/QuestgroupsController.inc b/controllers/QuestgroupsController.inc index 3d24a678..8eb03d38 100644 --- a/controllers/QuestgroupsController.inc +++ b/controllers/QuestgroupsController.inc @@ -73,10 +73,14 @@ // Check permission if(count(array_intersect(array('admin','moderator'), SeminaryController::$character['characterroles'])) == 0) { - $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']); - if(!is_null($previousQuestgroup)) { - if(!$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { - throw new \nre\exceptions\AccessDeniedException(); + // Only check permissions if Character has not entered Quest before + if(!$this->Questgroups->hasCharacterEnteredQuestgroup($questgroup['id'], $character['id'])) + { + $previousQuestgroup = $this->Questgroups->getPreviousQuestgroup($questgroup['id']); + if(!is_null($previousQuestgroup)) { + if(!$this->Questgroups->hasCharacterSolvedQuestgroup($previousQuestgroup['id'], $character['id'])) { + throw new \nre\exceptions\AccessDeniedException(); + } } } }