aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/app/src/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'services/app/src/App.php')
-rw-r--r--services/app/src/App.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/app/src/App.php b/services/app/src/App.php
index b2ffba0..aef1b12 100644
--- a/services/app/src/App.php
+++ b/services/app/src/App.php
@@ -954,7 +954,9 @@ final class App
'error' => 'not_found',
])->withStatus(404);
}
- if ($quiz->isRankingHidden()) {
+ $currentUser = $this->getCurrentUser($request);
+ $isAdmin = $currentUser !== null ? $currentUser->is_admin : false;
+ if ($quiz->isRankingHidden() && !$isAdmin) {
return $this->makeJsonResponse($response, [
'error' => 'forbidden',
])->withStatus(403);