Skip to content

Commit

Permalink
Fixing bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed May 24, 2024
1 parent 7ecc927 commit 63806e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/V1Module/presenters/GroupsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

/**
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 63806e7

Please sign in to comment.