所有HTTP安全启动应用:配置Spring HTTP安全性在运行
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/admin/**").hasRole("admin")
}
在运行时,我想多给它添加...
applicationContext.getBean(WebSecurityConfigurerAdapter).http.authorizeRequests().antMatchers("bla").hasRole("admin")
在执行这条线,它将它添加到http.authorizeRequests()中,但/ bla仍可通过“非管理员”访问
当服务器重新启动时,此更改将生效,因为它正从数据库加载bla。
如何在不重新启动服务器的情况下立即生效?
您是否得到了解决方案? – theLearner
nope,如果你知道一个请分享:D –