[issue - 65] edit style of configuration
@@ -66,28 +66,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.csrf()
.disable()
.authorizeRequests()
- .antMatchers("/ownSecurity/**")
- .permitAll()
- .antMatchers("/place/getListPlaceLocationByMapsBounds/**")
- .permitAll()
- .antMatchers("/place/propose/**")
- .hasAnyRole("USER", "ADMIN", "MODERATOR")
- .antMatchers("/place/{status}")
- .hasAnyRole("USER", "ADMIN", "MODERATOR")
- .antMatchers("/place/status**")
- .hasAnyRole("ADMIN", "MODERATOR")
- .antMatchers("/favoritePlace/**")
- .hasAnyRole("USER", "ADMIN", "MODERATOR")
- .antMatchers("/place/save/favoritePlace")
- .hasAnyRole("USER", "ADMIN", "MODERATOR")
- .antMatchers(HttpMethod.PATCH, "/user/status")
- .hasAnyRole("ADMIN", "MODERATOR")
- .antMatchers(HttpMethod.PATCH, "/user/role")
- .hasRole("ADMIN")
- .antMatchers(HttpMethod.GET, "/user")
- .hasAnyRole("ADMIN", "MODERATOR")
- .anyRequest()
- .hasAnyRole("ADMIN")
+ .antMatchers("/ownSecurity/**").permitAll()
+ .antMatchers("/place/getListPlaceLocationByMapsBounds/**").permitAll()
+ .antMatchers("/place/propose/**").hasAnyRole("USER", "ADMIN", "MODERATOR")
+ .antMatchers("/place/{status}").hasAnyRole("USER", "ADMIN", "MODERATOR")
+ .antMatchers("/place/status**").hasAnyRole("ADMIN", "MODERATOR")
+ .antMatchers("/favoritePlace/**").hasAnyRole("USER", "ADMIN", "MODERATOR")
+ .antMatchers("/place/save/favoritePlace").hasAnyRole("USER", "ADMIN", "MODERATOR")
+ .antMatchers(HttpMethod.PATCH, "/user/status").hasAnyRole("ADMIN", "MODERATOR")
+ .antMatchers(HttpMethod.PATCH, "/user/role").hasRole("ADMIN")
+ .antMatchers(HttpMethod.GET, "/user").hasAnyRole("ADMIN", "MODERATOR")
+ .anyRequest().hasAnyRole("ADMIN")
.and()
.apply(new JwtConfig(tool));
}
