@@ -54,18 +54,15 @@ public SecurityFilterChain devSecurityFilterChain(HttpSecurity http) throws Exce
5454 .requestMatchers ("/swagger-ui/**" , "/v3/api-docs/**" ).permitAll ()
5555 .requestMatchers ("/api/users/login" , "/api/users/signup" ).permitAll ()
5656 .requestMatchers ("/api/code/**" ).permitAll ()
57- // ★ (유지) GET 요청은 누구나 접근 가능
5857 .requestMatchers (HttpMethod .GET , "/api/posts/**" , "/api/comments/**" ).permitAll ()
5958
6059 // 2. USER 또는 ADMIN 권한이 필요한 경로
61- // ★ (수정) POST, PUT, DELETE 등 GET 외의 메서드는 USER 또는 ADMIN 권한 필요
6260 .requestMatchers (HttpMethod .POST , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
6361 .requestMatchers (HttpMethod .PUT , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
6462 .requestMatchers (HttpMethod .DELETE , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
6563 .requestMatchers (HttpMethod .PATCH , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
64+ .requestMatchers (HttpMethod .GET , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
6665
67- // ★ (수정) GET을 제외한 나머지 /api/notifications/** 경로는 여기서 처리됩니다.
68- .requestMatchers ("/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
6966 .requestMatchers ("/api/report/**" ).hasAnyRole ("USER" , "ADMIN" )
7067 .requestMatchers ("/api/files/**" ).hasAnyRole ("USER" , "ADMIN" )
7168 .requestMatchers ("/api/collab" ).hasAnyRole ("USER" , "ADMIN" )
@@ -103,14 +100,13 @@ public SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws
103100 .requestMatchers ("/api/admin/**" ).hasRole ("ADMIN" )
104101
105102 // 3. USER 또는 ADMIN 권한이 필요한 경로
106- // ★ (수정) POST, PUT, DELETE 등 GET 외의 메서드는 USER 또는 ADMIN 권한 필요
107103 .requestMatchers (HttpMethod .POST , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
108104 .requestMatchers (HttpMethod .PUT , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
109105 .requestMatchers (HttpMethod .DELETE , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
110- .requestMatchers (HttpMethod .PATCH , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" ) // (PATCH도 명시)
106+ .requestMatchers (HttpMethod .PATCH , "/api/posts/**" , "/api/comments/**" , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
107+ .requestMatchers (HttpMethod .GET , "/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
108+
111109
112- // ★ (수정) GET을 제외한 나머지 /api/notifications/** 경로는 여기서 처리됩니다.
113- .requestMatchers ("/api/notifications/**" ).hasAnyRole ("USER" , "ADMIN" )
114110 .requestMatchers ("/api/report/**" ).hasAnyRole ("USER" , "ADMIN" )
115111 .requestMatchers ("/api/files/**" ).hasAnyRole ("USER" , "ADMIN" )
116112 .requestMatchers ("/api/collab" ).hasAnyRole ("USER" , "ADMIN" )
0 commit comments