only check permissions for Questgroup if entered-status has not been set (Issue #279)
This commit is contained in:
parent
eea226c1c2
commit
e4a030ce1f
1 changed files with 8 additions and 4 deletions
|
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue