반응형
표현식
-
[스프링 시큐리티] 권한 설정과 표현식강의노트/스프링 시큐리티 2020. 9. 10. 21:27
권한 설정 선언적 방식 Url을 이용한 방식 protected void configure(HttpSecurity http) throws Exception { http .antMatchers("/users/**") .authorizeRequests() .antMatchers("/shop/login", "/shop/users/**").permitAll() .antMatchers("/shop/mypage").hasRole("ROLE_USER") .antMatchers("/shop/admin/pay").access("hasRole('ROLE_ADMIN')") .antMatchers("/shop/admin/**").access("hasRole('ROLE_ADMIN') or hasRole('ROLE_SYS')") ..