From 86b44795dd4cc710edd610864dd26279147f0cdc Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Wed, 29 May 2024 19:36:04 +0400 Subject: [PATCH] minor fix --- .../main/java/com/ip/library/users/api/UserBookController.java | 3 +++ 1 file changed, 3 insertions(+) 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;