From fbc5d8378045000da45d523a9e7151683b456450 Mon Sep 17 00:00:00 2001 From: Hedi Date: Fri, 21 Jan 2022 18:33:37 +0100 Subject: [PATCH] fix merge bis --- .../java/fr/organizee/controller/MembreController.java | 2 +- src/main/java/fr/organizee/controller/TeamController.java | 8 ++++---- src/main/java/fr/organizee/model/Membre.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java index 90c1433..93df3d8 100644 --- a/src/main/java/fr/organizee/controller/MembreController.java +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -121,7 +121,7 @@ public class MembreController { //Efface un membre par son ID @DeleteMapping(value = "/delete/{id}") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity deleteMembre(@PathVariable int id){ try { membreRepo.delete(membreRepo.getById(id)); diff --git a/src/main/java/fr/organizee/controller/TeamController.java b/src/main/java/fr/organizee/controller/TeamController.java index 7b6d9d3..1d96ae5 100644 --- a/src/main/java/fr/organizee/controller/TeamController.java +++ b/src/main/java/fr/organizee/controller/TeamController.java @@ -33,7 +33,7 @@ public class TeamController { // Récupération de toutes les teams @GetMapping(value = "/all") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity getAllTeam(){ List liste = null; try @@ -61,7 +61,7 @@ public class TeamController { } @PostMapping(value="/add", produces="application/json", consumes="application/json") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity addTeam(@RequestBody Team team){ Team resultTeam = null; try { @@ -74,7 +74,7 @@ public class TeamController { } @PutMapping("/update/{id}") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity updateTeam(@RequestBody Team team, @PathVariable Integer id) throws Exception { Team resultTeam = null; try { @@ -88,7 +88,7 @@ public class TeamController { } @DeleteMapping(value = "/delete/{id}") - @PreAuthorize("hasRole('ROLE_PARENT')") + //@PreAuthorize("hasRole('ROLE_PARENT')") public ResponseEntity deleteTeam(@PathVariable int id){ try { teamRepo.delete(teamRepo.getById(id)); diff --git a/src/main/java/fr/organizee/model/Membre.java b/src/main/java/fr/organizee/model/Membre.java index 231359d..c8cc3d8 100644 --- a/src/main/java/fr/organizee/model/Membre.java +++ b/src/main/java/fr/organizee/model/Membre.java @@ -36,7 +36,7 @@ public class Membre { // @ManyToOne // @JoinColumn(name="TEAM_ID") // @JsonIgnore - @ManyToOne(cascade = CascadeType.MERGE) + @ManyToOne @JoinColumn(name="TEAM_ID") @JsonIgnoreProperties("membre") private Team team;