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(); }