@@ -79,12 +79,21 @@ class Camp extends BaseEntity implements BelongsToCampInterface, CopyFromPrototy
7979 public Collection $ collaborations ;
8080
8181 /**
82- * UserCamp Collections
83- * Based von view_user_camps; lists all user who can see this camp.
82+ * UserCamp Collection
83+ * Based von view_user_camps; lists all user who can see this camp through campCollaborations .
8484 */
8585 #[ORM \OneToMany(targetEntity: UserCamp::class, mappedBy: 'camp ' )]
8686 public Collection $ userCamps ;
8787
88+ /**
89+ * UserCampWithPublic Collection
90+ * Based von view_user_camps_with_public; lists all user who can see this camp, through
91+ * campCollaborations or because the camps are prototypes or shared.
92+ */
93+ #[ORM \OneToMany(targetEntity: UserCampWithPublic::class, mappedBy: 'camp ' )]
94+ #[Assert \DisableAutoMapping]
95+ public Collection $ userCampsWithPublic ;
96+
8897 /**
8998 * The time periods of the camp, there must be at least one. Periods in a camp may not overlap.
9099 * When creating a camp, the initial periods may be specified as nested payload, but updating,
@@ -462,13 +471,20 @@ public function getCampCollaborations(): array {
462471 return [];
463472 }
464473
474+ #[ApiProperty(writable: false , readableLink: true , security: '!is_granted("CAMP_COLLABORATOR", object) ' )]
475+ #[SerializedName('campCollaborations ' )]
476+ #[Groups('Camp:CampCollaborations ' )]
477+ public function getRedactedEmbeddedCampCollaborations (): array {
478+ return [];
479+ }
480+
465481 /**
466482 * The people working on planning and carrying out the camp. Only collaborators have access
467483 * to the camp's contents.
468484 *
469485 * @return CampCollaboration[]
470486 */
471- #[ApiProperty(writable: false , readableLink: true )]
487+ #[ApiProperty(writable: false , readableLink: true , security: ' is_granted("CAMP_COLLABORATOR", object) ' )]
472488 #[SerializedName('campCollaborations ' )]
473489 #[Groups('Camp:CampCollaborations ' )]
474490 public function getEmbeddedCampCollaborations (): array {
0 commit comments