|
|
@@ -51,10 +51,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
// .antMatchers("/**/*api-docs*/**").permitAll()
|
|
|
// .antMatchers("/**/hook").permitAll()
|
|
|
// .antMatchers("/**/query/**").permitAll()
|
|
|
- .antMatchers("/**/*swagger*/**").anonymous()
|
|
|
- .antMatchers("/**/*api-docs*/**").anonymous()
|
|
|
- .antMatchers("/**/hook").anonymous()
|
|
|
- .antMatchers("/**/query/**").anonymous()
|
|
|
+
|
|
|
//
|
|
|
// .and()
|
|
|
// .authorizeRequests()
|
|
|
@@ -112,6 +109,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
.antMatchers(HttpMethod.POST, "/api/tree/subNode/{fatherId}").access("@authTools.checkTreeNodeOwnership(#fatherId)")
|
|
|
.antMatchers(HttpMethod.PUT, "/api/tree/node").access("@authTools.checkTreeNodeOwnershipBody(request)")
|
|
|
.antMatchers(HttpMethod.PUT, "/api/tree/node/type/task/{projectId}").access("@authTools.checkProjOwnership(#projectId)")
|
|
|
+ // Swagger
|
|
|
+ .antMatchers("/**/*swagger*/**").anonymous()
|
|
|
+ .antMatchers("/**/*api-docs*/**").anonymous()
|
|
|
+ .antMatchers("/**/hook").anonymous()
|
|
|
+ .antMatchers("/**/query/**").anonymous()
|
|
|
//跨域的Options请求进行放行
|
|
|
.requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
|
|
|
.antMatchers("/**").hasAnyRole(WebSecurityConstants.STUDENT_ROLE, WebSecurityConstants.ADMIN_ROLE, WebSecurityConstants.TEACHER_ROLE)
|