Skip to content

Commit 56b2144

Browse files
committed
Security: Update security check for User and Course GetCollection to require ROLE_ADMIN or ROLE_TEACHER
1 parent d0d7cb6 commit 56b2144

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/CoreBundle/Entity/Course.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
read: false,
7272
deserialize: false,
7373
),
74-
new Post(security: "is_granted('ROLE_USER')"),
75-
new GetCollection(security: "is_granted('ROLE_USER')"),
74+
new Post(security: "is_granted('ROLE_TEACHER') or is_granted('ROLE_ADMIN')"),
75+
new GetCollection(security: "is_granted('ROLE_TEACHER') or is_granted('ROLE_ADMIN')"),
7676
new GetCollection(
7777
uriTemplate: '/public_courses',
7878
normalizationContext: ['groups' => ['course:read']],

src/CoreBundle/Entity/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
),
105105
new Put(security: "is_granted('EDIT', object)"),
106106
new Delete(security: "is_granted('DELETE', object)"),
107-
new GetCollection(security: "is_granted('ROLE_USER')"),
107+
new GetCollection(security: "is_granted('ROLE_ADMIN')"),
108108
new Post(security: "is_granted('ROLE_ADMIN')"),
109109
new GetCollection(
110110
uriTemplate: '/users/{id}/skills',

0 commit comments

Comments
 (0)