Skip to content

Commit 1c088e8

Browse files
committed
Don't reference undisclosed problems in clarifications before conteststart
1 parent 7a7c73a commit 1c088e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webapp/src/Controller/API/ClarificationController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ protected function getQueryBuilder(Request $request): QueryBuilder
297297
}
298298
}
299299

300+
// For non-API-reader users, only expose the problems after the contest has started.
301+
// `WF Access Policy` allows for clarifications before the contest, but not to disclose the problem
302+
// so referencing them in clarifications would violate referential integrity.
303+
if (!$this->dj->checkrole('api_reader')) {
304+
$queryBuilder->andWhere('c.starttime < :now OR clar.problem IS NULL')
305+
->setParameter('now', Utils::now());
306+
}
307+
300308
if ($request->query->has('problem')) {
301309
$queryBuilder
302310
->andWhere('clar.problem = :problem')

0 commit comments

Comments
 (0)