(오류 수집) ‘hasRole(‘ROLE_USER’) 또는 hasRole(‘ROLE_MANAGER’) 또는 hasROLE(‘ROLE_ADMIN’)’ 식을 평가하는 동안 오류가 발생했습니다.
오류 설명 Java 프로젝트에서 SecurityConfig.java를 통해 보안 필터를 통해 웹 페이지에 액세스하는 중 오류가 발생했습니다. 에러 메시지 @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) @RequiredArgsConstructor public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .formLogin().disable() .httpBasic().disable() .authorizeRequests() .antMatchers(“/api/v1/user/**”) .access(“hasRole(‘ROLE_USER’) or hasRole(‘ROLE_MANAGER’) or hasROLE(‘ROLE_ADMIN’)”) .antMatchers(“/api/v1/manager/**”) .access(“hasRole(‘ROLE_MANAGER’) or hasRole(‘ROLE_ADMIN’)”) … Read more