diff --git a/SpringApp/library/src/main/java/com/ip/library/users/api/UserBookController.java b/SpringApp/library/src/main/java/com/ip/library/users/api/UserBookController.java index 24e8edc..74567c4 100644 --- a/SpringApp/library/src/main/java/com/ip/library/users/api/UserBookController.java +++ b/SpringApp/library/src/main/java/com/ip/library/users/api/UserBookController.java @@ -3,6 +3,7 @@ package com.ip.library.users.api; import java.util.List; import org.modelmapper.ModelMapper; +import org.springframework.security.access.annotation.Secured; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -12,9 +13,11 @@ import org.springframework.web.bind.annotation.RestController; import com.ip.library.books.api.BookDto; import com.ip.library.books.model.BookEntity; import com.ip.library.core.configuration.Constants; +import com.ip.library.users.model.UserRole; import com.ip.library.users.service.UserService; @RestController +@Secured(value = { UserRole.Secured.USER, UserRole.Secured.ADMIN }) @RequestMapping(Constants.API_URL + "/user/{userId}/book") public class UserBookController { private final UserService userService;