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