권한 설정
스프링 부트 설정
Section titled “스프링 부트 설정”- 스프링 시큐리티 권한 설정을 사용하지 않고 독자적인 권한 로직을 사용한다.
- 시큐리티 권한 설정에서 모든 경로에 대해 접근 권한을 허용하도록 설정한다.
SecurityConfig.kt @Beanfun filterChain(http: HttpSecurity): SecurityFilterChain {http {csrf {disable()}formLogin {disable()}cors {disable()}httpBasic {disable()}authorizeHttpRequests {authorize(anyRequest, permitAll)}sessionManagement {sessionCreationPolicy = SessionCreationPolicy.IF_REQUIRED}}return http.build()}SecurityConfig.java - API 의 경우에는 인터셉터에서 API 요청이 들어올때마다 실행 권한을 확인하여 권한이 없는 경우에 UNAUTHORIZED 응답코드를 반환한다.
- 메뉴의 경우에는 메뉴 조회 API에서 로그인 사용자에 대해 조회(쓰기)권한이 있는 메뉴를 반환하도록 구성한다.
- 설정
- 설정