[Spring] @Secured ์ฌ์ฉ ์ AccessDeniedException์ด CustomAccessDeniedHandler์์ ์ฒ๋ฆฌ๋์ง ์๋ ์ด์
ยท
Spring
Spring Security๋ฅผ ์ฌ์ฉํ๋ค ๋ณด๋ฉด ๊ถํ์ด ์๋ ์ฌ์ฉ์์ ์ ๊ทผ์ ์ ์ดํ๊ธฐ ์ํด ๋ฉ์๋ ๋จ์์์ @Secured ์ด๋
ธํ
์ด์
์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค. ๋๋ @Secure ์ด๋
ธํ
์ด์
์ ์ฌ์ฉํ์ฌ ๋ฉ์๋ ์คํ ์ ์ ์ฌ์ฉ์์ ๊ถํ์ ๋ฐ๋ผ ์ ๊ทผ์ ์ ํํ๋๋ก ์ฒ๋ฆฌํ๋ค. @Operation(summary = "[๊ด๋ฆฌ์] ๋ฆฌ์คํธ ์กฐํ", description = "๊ด๋ฆฌ์ ๋ฆฌ์คํธ ์กฐํ", security = @SecurityRequirement(name = "bearerAuth")) @Secured("ROLE_ROOT") // ๋ฃจํธ ๊ถํ์ธ ์ฌ์ฉ์๋ง ํ์ฉ @GetMapping("/list") public ResponseDto list(@RequestParam(required = false, de..