|
38 | 38 | security: 'is_granted("CAMP_COLLABORATOR", object) or is_granted("CAMP_IS_PUBLIC", object)' |
39 | 39 | ), |
40 | 40 | new Patch( |
41 | | - processor: CampCollaborationUpdateProcessor::class, |
42 | | - denormalizationContext: ['groups' => ['write', 'update']], |
43 | 41 | normalizationContext: self::ITEM_NORMALIZATION_CONTEXT, |
| 42 | + denormalizationContext: ['groups' => ['write', 'update']], |
44 | 43 | security: '(is_authenticated() && user === object.user) or is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)', |
45 | | - validationContext: ['groups' => ['Default', 'update']] |
| 44 | + validationContext: ['groups' => ['Default', 'update']], |
| 45 | + processor: CampCollaborationUpdateProcessor::class |
46 | 46 | ), |
47 | 47 | new Delete( |
48 | | - validate: true, |
| 48 | + security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)', |
49 | 49 | validationContext: ['groups' => ['delete']], |
50 | | - security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)' |
| 50 | + validate: true |
51 | 51 | ), |
52 | 52 | new Patch( |
53 | | - processor: CampCollaborationResendInvitationProcessor::class, |
54 | | - security: '(is_authenticated() && user === object.user) or is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)', |
55 | 53 | uriTemplate: 'camp_collaborations/{id}/'.self::RESEND_INVITATION, |
56 | | - denormalizationContext: ['groups' => ['resend_invitation']], |
57 | 54 | openapi: new OpenApiOperation(summary: 'Send the invitation email for this CampCollaboration again. Only possible, if the status is already invited.'), |
58 | | - validationContext: ['groups' => ['Default', 'resend_invitation']] |
| 55 | + denormalizationContext: ['groups' => ['resend_invitation']], |
| 56 | + security: '(is_authenticated() && user === object.user) or is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)', |
| 57 | + validationContext: ['groups' => ['Default', 'resend_invitation']], |
| 58 | + processor: CampCollaborationResendInvitationProcessor::class |
59 | 59 | ), |
60 | 60 | new GetCollection( |
61 | | - security: 'is_fully_authenticated()', |
62 | | - normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT |
| 61 | + normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT, |
| 62 | + security: 'is_fully_authenticated()' |
63 | 63 | ), |
64 | 64 | new GetCollection( |
65 | 65 | uriTemplate: self::CAMP_SUBRESOURCE_URI_TEMPLATE, |
|
71 | 71 | is_granted("CAMP_IS_PUBLIC", camp)' |
72 | 72 | ), |
73 | 73 | ], |
74 | | - security: 'is_fully_authenticated()', |
75 | | - normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT |
| 74 | + normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT, |
| 75 | + security: 'is_fully_authenticated()' |
76 | 76 | ), |
77 | 77 | new Post( |
78 | | - processor: CampCollaborationCreateProcessor::class, |
79 | | - denormalizationContext: ['groups' => ['write', 'create']], |
80 | | - normalizationContext: self::ITEM_NORMALIZATION_CONTEXT, |
81 | 78 | openapi: new OpenApiOperation(description: 'Also sends an invitation email to the inviteEmail address, if specified.'), |
82 | | - securityPostDenormalize: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object) or object.camp === null' |
| 79 | + normalizationContext: self::ITEM_NORMALIZATION_CONTEXT, |
| 80 | + denormalizationContext: ['groups' => ['write', 'create']], |
| 81 | + securityPostDenormalize: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object) or object.camp === null', |
| 82 | + processor: CampCollaborationCreateProcessor::class |
83 | 83 | ), |
84 | 84 | ], |
85 | 85 | denormalizationContext: ['groups' => ['write']], |
|
0 commit comments