【发布时间】:2018-06-02 10:46:45
【问题描述】:
我正在开发一个 Web 服务,它使用 Spring Security 工具箱来授权“权威”的请求。当然,Web 服务有一个配置类,该类扩展为 WebSecurityConfigurerAdapter 类并覆盖了 configure(HttpSecurity http) 方法。
在该方法中,我使用以下代码编写了配置文件(角色或权限):
http
.authorizeRequests()
.antMatchers("/**").hasAnyAuthority("PERFIL")
.anyRequest().authenticated()
.and()
.logout().clearAuthentication(true)
.invalidateHttpSession(true)
.and()
.csrf().disable();
它工作得很好,但是我想从数据库中收取动态配置文件(角色或权限),因为我想在不更改 Web 服务的情况下更改它们。
有人知道怎么做吗?
问候。
【问题讨论】:
标签: java spring spring-mvc