From 63806e7689add3ce03523507a33b77e9d6c519f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kruli=C5=A1?= Date: Sun, 18 Feb 2024 19:06:27 +0100 Subject: [PATCH] Fixing bugs. --- app/V1Module/presenters/GroupsPresenter.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/V1Module/presenters/GroupsPresenter.php b/app/V1Module/presenters/GroupsPresenter.php index ef2bad19..bd059805 100644 --- a/app/V1Module/presenters/GroupsPresenter.php +++ b/app/V1Module/presenters/GroupsPresenter.php @@ -364,6 +364,10 @@ public function checkSetOrganizational(string $id) if (!$this->groupAcl->canSetOrganizational($group)) { throw new ForbiddenRequestException(); } + + if ($group->isExam()) { + throw new BadRequestException("Organizational group must not be exam group."); + } } /** @@ -474,6 +478,10 @@ public function checkSetExam(string $id) throw new BadRequestException("Exam group must have no sub-groups."); } + if ($group->isOrganizational()) { + throw new BadRequestException("Exam group must not be organizational."); + } + if (!$this->groupAcl->canSetExamFlag($group)) { throw new ForbiddenRequestException(); }