refactor(core) : RBAC #345 - replace ROLE_ADMIN placeholders with RBAC codes

This commit is contained in:
Matthieu
2026-04-15 16:02:57 +02:00
parent 80b63cd7d7
commit b05c10097f
3 changed files with 14 additions and 21 deletions

View File

@@ -35,31 +35,26 @@ use Symfony\Component\Validator\Constraints as Assert;
operations: [
new GetCollection(
normalizationContext: ['groups' => ['role:read']],
// TODO ticket #345 : remplacer par is_granted('core.roles.manage')
security: "is_granted('ROLE_ADMIN')",
security: "is_granted('core.roles.view')",
),
new Get(
normalizationContext: ['groups' => ['role:read']],
// TODO ticket #345 : remplacer par is_granted('core.roles.manage')
security: "is_granted('ROLE_ADMIN')",
security: "is_granted('core.roles.view')",
),
new Post(
normalizationContext: ['groups' => ['role:read']],
denormalizationContext: ['groups' => ['role:write']],
// TODO ticket #345 : remplacer par is_granted('core.roles.manage')
security: "is_granted('ROLE_ADMIN')",
security: "is_granted('core.roles.manage')",
processor: RoleProcessor::class,
),
new Patch(
normalizationContext: ['groups' => ['role:read']],
denormalizationContext: ['groups' => ['role:write']],
// TODO ticket #345 : remplacer par is_granted('core.roles.manage')
security: "is_granted('ROLE_ADMIN')",
security: "is_granted('core.roles.manage')",
processor: RoleProcessor::class,
),
new Delete(
// TODO ticket #345 : remplacer par is_granted('core.roles.manage')
security: "is_granted('ROLE_ADMIN')",
security: "is_granted('core.roles.manage')",
processor: RoleProcessor::class,
),
],