Spring Security构建Rest服务-1401-权限表达式

Spring Security 的权限表达式

用法,在自定义的BrowserSecurityConfig extends WebSecurityConfigurerAdapter 配置文件里,每一个antMatchers匹配器后,使用权限表达式。(注意hasRole在UserDetailsService类里loadUserByUsername方法返回user的权限集合,需要加上前缀 ROLE_  角色)

多个权限表达式写法

原文地址:https://www.cnblogs.com/lihaoyang/p/8609894.html