diff --git a/api/src/Entity/ActivityProgressLabel.php b/api/src/Entity/ActivityProgressLabel.php index ef6d2fc1ae..e4805e7819 100644 --- a/api/src/Entity/ActivityProgressLabel.php +++ b/api/src/Entity/ActivityProgressLabel.php @@ -36,6 +36,8 @@ validationContext: ['groups' => ['Default', 'update']] ), new Delete( + validate: true, + validationContext: ['groups' => ['delete']], security: 'is_granted("CAMP_MANAGER", object)' ), new GetCollection( diff --git a/api/src/Entity/CampCollaboration.php b/api/src/Entity/CampCollaboration.php index d26edbe1fb..16e2a0fb5e 100644 --- a/api/src/Entity/CampCollaboration.php +++ b/api/src/Entity/CampCollaboration.php @@ -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( diff --git a/api/src/Entity/Category.php b/api/src/Entity/Category.php index 6d274dc3a0..03fccdd46c 100644 --- a/api/src/Entity/Category.php +++ b/api/src/Entity/Category.php @@ -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()' diff --git a/api/src/Entity/MaterialList.php b/api/src/Entity/MaterialList.php index 1479994114..3485e82241 100644 --- a/api/src/Entity/MaterialList.php +++ b/api/src/Entity/MaterialList.php @@ -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()' diff --git a/api/src/Entity/Period.php b/api/src/Entity/Period.php index 67f47430fa..bdecf059f7 100644 --- a/api/src/Entity/Period.php +++ b/api/src/Entity/Period.php @@ -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( diff --git a/api/src/Entity/ScheduleEntry.php b/api/src/Entity/ScheduleEntry.php index 9be8acc825..b5424bdabf 100644 --- a/api/src/Entity/ScheduleEntry.php +++ b/api/src/Entity/ScheduleEntry.php @@ -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(