【发布时间】:2020-07-14 21:09:14
【问题描述】:
我覆盖了 SpringWebConfig 中的方法,我想只为管理员提供应用程序的所有页面。
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/*", "/**").hasRole("ADMIN");
}
当我尝试在没有任何授权的情况下打开页面 http://localhost:8080/api/v1/skills/ 时,我得到了正确的结果而不是 403。也许我的配置有误? 完整项目https://github.com/Wismut/crud_developers
【问题讨论】:
标签: java spring spring-mvc spring-security