Skip to content

Commit

Permalink
Merge pull request #5275 from usu/chore/remove-delete-listener
Browse files Browse the repository at this point in the history
chore(api): remove ValidateDeleteRequestsListener
  • Loading branch information
usu committed Jun 2, 2024
2 parents c4181e1 + 554ed48 commit fe4a8da
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 168 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
46 changes: 0 additions & 46 deletions api/src/EventListener/ValidateDeleteRequestsListener.php

This file was deleted.

Loading

0 comments on commit fe4a8da

Please sign in to comment.