Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/integration' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiWonYu committed Sep 11, 2024
2 parents 947cc5c + e0295e1 commit 14768e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@ToString
public enum Role {

ROLE_ADMIN("ROLE_ADMIN"), ROLE_USER("ROLE_USER");
ROLE_ADMIN("ROLE_ADMIN"), ROLE_USER("ROLE_USER"), ROLE_WEB("ROLE_WEB");

private String role;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
Expand Down Expand Up @@ -47,7 +48,9 @@ public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception
.authorizeHttpRequests(authorize -> authorize
.requestMatchers(AUTH_WHITELIST).permitAll()
.requestMatchers("/admin/**").hasRole("ADMIN")
.anyRequest().authenticated()
.requestMatchers(HttpMethod.GET, "/**").hasRole("WEB")
.requestMatchers("/**").hasAnyRole("ADMIN", "USER")
.anyRequest().denyAll()
)
.addFilterBefore(new JwtAuthFilter(tokenManager, userDetailsService),
UsernamePasswordAuthenticationFilter.class)
Expand Down

0 comments on commit 14768e5

Please sign in to comment.