@@ -39,6 +39,8 @@ public class ReservationController {
3939 @ ApiResponse (responseCode = "200" , description = "Успешно" , content = @ Content (mediaType = "application/json" , schema = @ Schema (implementation = ReservationDTO [].class ))),
4040 @ ApiResponse (responseCode = "500" , description = "Непредвиденная ошибка со стороны сервера" , content = @ Content )
4141 })
42+ @ PreAuthorize ("hasAuthority('ROLE_ADMIN')" )
43+ @ SecurityRequirement (name = "JWT" )
4244 @ GetMapping ("/" )
4345 public ResponseEntity <List <ReservationDTO >> getReservations () {
4446 List <ReservationDTO > reservationDTOS = reservationService .findAllReservations ();
@@ -72,7 +74,7 @@ public ResponseEntity<List<ReservationDTO>> getUserReservations(Authentication a
7274 @ ApiResponse (responseCode = "422" , description = "Ошибка валидации" , content = @ Content ),
7375 @ ApiResponse (responseCode = "500" , description = "Непредвиденная ошибка со стороны сервера" , content = @ Content )
7476 })
75- @ PreAuthorize ("hasAuthority('ROLE_ADMIN') or hasAuthority('ROLE_USER')" )
77+ @ PreAuthorize ("hasAuthority('ROLE_ADMIN')" )
7678 @ SecurityRequirement (name = "JWT" )
7779 @ GetMapping ("/{id}" )
7880 public ResponseEntity <ReservationDTO > getReservation (@ PathVariable
@@ -114,7 +116,6 @@ public ResponseEntity<ReservationDTO> createReservation(@Valid @ModelAttribute R
114116 })
115117 @ PreAuthorize ("hasAuthority('ROLE_ADMIN') or hasAuthority('ROLE_USER')" )
116118 @ SecurityRequirement (name = "JWT" )
117- @ SecurityRequirement (name = "JWT" )
118119 @ PatchMapping (path = "/{id}" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
119120 public ResponseEntity <ReservationDTO > updateReservation (@ PathVariable @ Parameter (description = "id бронирования для изменения" ) long id ,
120121 @ Valid @ ModelAttribute ReservationCreateEditDTO reservationCreateEditDTO ) {
@@ -133,7 +134,6 @@ public ResponseEntity<ReservationDTO> updateReservation(@PathVariable @Parameter
133134 })
134135 @ PreAuthorize ("hasAuthority('ROLE_ADMIN') or hasAuthority('ROLE_USER')" )
135136 @ SecurityRequirement (name = "JWT" )
136- @ SecurityRequirement (name = "JWT" )
137137 public ResponseEntity <ReservationDTO > deleteReservation (
138138 @ PathVariable
139139 @ Valid @ Parameter (description = "id бронирования" , example = "1" ) long id ,
0 commit comments