Skip to content

Commit

Permalink
fix: image 조회 API 권한 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchef1 committed May 19, 2024
1 parent 3180e2a commit 84e2d06
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
//경로별 인가 작업
.authorizeHttpRequests((auth) -> auth
.requestMatchers("/signup", "/login", "/checkUserName/{username}").permitAll()
.requestMatchers(HttpMethod.GET, "/post", "/post/{title}", "/post/random").hasAnyRole("GUEST", "ACTIVE", "ADMIN")
.requestMatchers("/post", "/post/{title}", "/post/upload").hasAnyRole("ACTIVE", "ADMIN")
.requestMatchers("/admin", "/admin/{id}").hasRole("ADMIN")
.anyRequest().authenticated())
.requestMatchers(HttpMethod.GET, "/post", "/post/random", "/post/{title}", "/image/{fileName}").hasAnyRole("GUEST", "ACTIVE", "ADMIN")
.requestMatchers("/post", "/post/upload", "/post/{title}").hasAnyRole("ACTIVE", "ADMIN")
.requestMatchers("/admin", "/admin/{id}").hasRole("ADMIN"))

// 필터 등록
.addFilterAt(new LoginFilter(authenticationManager(authenticationConfiguration), jwtTokenProvider, objectMapper), UsernamePasswordAuthenticationFilter.class)
Expand Down

0 comments on commit 84e2d06

Please sign in to comment.