Skip to content

Commit a2cca24

Browse files
committed
Fixing ACLs policies for exams (students can submit anything in a group before the beginning of an exam).
1 parent dbed831 commit a2cca24

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/V1Module/security/Policies/AssignmentPermissionPolicy.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,14 @@ public function userIsNotLockedElsewhereStrictly(Identity $identity, Assignment
123123
}
124124

125125
/**
126-
* The assignment is not in an exam group, or it is already after the exam.
126+
* The assignment is not in an exam group, or it is still before/already after the exam.
127127
*/
128128
public function isExamNotInProgress(Identity $identity, Assignment $assignment): bool
129129
{
130130
$group = $assignment->getGroup();
131131
$now = new DateTime();
132-
return $group && (!$group->hasExamPeriodSet($now) || $group->getExamEnd() < $now);
132+
return $group && (!$group->hasExamPeriodSet($now) ||
133+
$now < $group->getExamBegin() || $group->getExamEnd() < $now);
133134
}
134135

135136
/**

app/V1Module/security/Policies/GroupPermissionPolicy.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Model\Entity\Group;
66
use App\Model\Entity\Instance;
7-
use App\Model\Repository\Groups;
87
use App\Security\Identity;
98
use DateTIme;
109

0 commit comments

Comments
 (0)