only check permissions for Questgroup if entered-status has not been set (Issue #279)

This commit is contained in:
coderkun 2014-05-15 12:12:32 +02:00
commit e4a030ce1f

View file

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