Skip to content

Commit 17bf2f0

Browse files
committed
Implement the rights of that group
As we replaced the access from admin to this new role we need to make sure Admin still has this access. The next step is actually making sure we can add the group to another user.
1 parent dc0d05b commit 17bf2f0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

webapp/config/packages/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
security:
44
role_hierarchy:
55
ROLE_JURY: [ROLE_CLARIFICATION_RW, ROLE_API, ROLE_API_READER, ROLE_API_SOURCE_READER]
6-
ROLE_ADMIN: [ROLE_JURY, ROLE_JUDGEHOST, ROLE_API_WRITER]
6+
ROLE_ADMIN: [ROLE_JURY, ROLE_JUDGEHOST, ROLE_API_WRITER, ROLE_API_PROBLEM_CHANGE]
77
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
88

99

webapp/src/Controller/API/ProblemController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
* @throws BadRequestHttpException
6262
* @throws NonUniqueResultException
6363
*/
64-
#[IsGranted('ROLE_ADMIN')]
64+
#[IsGranted('ROLE_API_PROBLEM_CHANGE')]
6565
#[Rest\Post('/add-data')]
6666
#[OA\RequestBody(
6767
required: true,
@@ -176,7 +176,7 @@ public function listAction(Request $request): Response
176176
* @return array{problem_id: string, messages: array<string, string[]>}
177177
* @throws NonUniqueResultException
178178
*/
179-
#[IsGranted('ROLE_ADMIN')]
179+
#[IsGranted('ROLE_API_PROBLEM_CHANGE')]
180180
#[Rest\Post('')]
181181
#[OA\RequestBody(
182182
required: true,
@@ -237,7 +237,7 @@ public function addProblemAction(Request $request): array
237237
/**
238238
* Unlink a problem from this contest.
239239
*/
240-
#[IsGranted('ROLE_ADMIN')]
240+
#[IsGranted('ROLE_API_PROBLEM_CHANGE')]
241241
#[Rest\Delete('/{id}')]
242242
#[OA\Response(response: 204, description: 'Problem unlinked from contest succeeded')]
243243
#[OA\Parameter(ref: '#/components/parameters/id')]
@@ -290,7 +290,7 @@ public function unlinkProblemAction(Request $request, string $id): Response
290290
/**
291291
* Link an existing problem to this contest.
292292
*/
293-
#[IsGranted('ROLE_ADMIN')]
293+
#[IsGranted('ROLE_API_PROBLEM_CHANGE')]
294294
#[Rest\Put('/{id}')]
295295
#[OA\Response(
296296
response: 200,

0 commit comments

Comments
 (0)