Skip to content

Commit

Permalink
enable delete validation for relevant operations
Browse files Browse the repository at this point in the history
  • Loading branch information
usu committed Jun 1, 2024
1 parent ea8c46e commit 009ae7b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions api/src/Entity/ActivityProgressLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
validationContext: ['groups' => ['Default', 'update']]
),
new Delete(
validate: true,
validationContext: ['groups' => ['delete']],
security: 'is_granted("CAMP_MANAGER", object)'
),
new GetCollection(
Expand Down
2 changes: 2 additions & 0 deletions api/src/Entity/CampCollaboration.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
validationContext: ['groups' => ['Default', 'update']]
),
new Delete(
validate: true,
validationContext: ['groups' => ['delete']],
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)'
),
new Patch(
Expand Down
4 changes: 3 additions & 1 deletion api/src/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
),
new Delete(
processor: CategoryRemoveProcessor::class,
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)'
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)',
validate: true,
validationContext: ['groups' => ['delete']],
),
new GetCollection(
security: 'is_authenticated()'
Expand Down
4 changes: 3 additions & 1 deletion api/src/Entity/MaterialList.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)'
),
new Delete(
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)'
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)',
validate: true,
validationContext: ['groups' => ['delete']]
),
new GetCollection(
security: 'is_authenticated()'
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
),
new Delete(
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)',
validate: true,
validationContext: ['groups' => ['delete', 'Period:delete']]
),
new GetCollection(
Expand Down
1 change: 1 addition & 0 deletions api/src/Entity/ScheduleEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
),
new Delete(
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)',
validate: true,
validationContext: ['groups' => ['delete', 'ScheduleEntry:delete']]
),
new GetCollection(
Expand Down

0 comments on commit 009ae7b

Please sign in to comment.