Spring Security 변경

This commit is contained in:
현성필
2024-04-25 10:48:33 +09:00
parent 7d97628d38
commit 01e6b34cdd
8 changed files with 92 additions and 77 deletions
@@ -11,6 +11,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
@@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/mgmt/servers")
@RequestMapping("/servers")
public class ServerRestController {
private final ServerMgmtService serverMgmtService;
@@ -31,6 +32,7 @@ public class ServerRestController {
}
@GetMapping("/list.do")
@Secured("ROLE_API_TESTER")
public ResponseEntity<List<ServerDTO>> listView(@ModelAttribute("serverSearch") ServerSearch serverSearch, ModelMap model, Pageable pageable) {
Page<Server> page = serverMgmtService.findAll(serverSearch.buildSpecification(), pageable);
HttpHeaders headers = new HttpHeaders();