Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fix: ReservationRoomController hasRole 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdtn0219 committed Nov 27, 2023
1 parent 7a53bed commit 5a5fb79
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import ybe.mini.travelserver.domain.reservation_room.dto.ReservationRoomGetResponse;
import ybe.mini.travelserver.domain.reservation_room.service.ReservationRoomService;
Expand All @@ -18,6 +19,7 @@ public class ReservationRoomController {

private final ReservationRoomService reservationRoomService;

@PreAuthorize("hasRole('ROLE_USER')")
@GetMapping("/{reservationId}")
public ResponseDto<List<ReservationRoomGetResponse>> getReservationRoomsByReserveId(
@PathVariable Long reservationId
Expand All @@ -28,7 +30,8 @@ public ResponseDto<List<ReservationRoomGetResponse>> getReservationRoomsByReserv
reservationRoomService.getReservationRoomsFromReservation(reservationId)
);
}


@PreAuthorize("hasRole('ROLE_USER')")
@DeleteMapping
public ResponseDto<Long> deleteReservationRoom(
@RequestParam Long reservationId,
Expand Down

0 comments on commit 5a5fb79

Please sign in to comment.