Skip to content

Commit 5b3881e

Browse files
authored
Merge pull request #381 from GSM-MSG/hotfix/380-student-put-location-permission
🔀 학생정보 수정 API 접근 권한 추가
2 parents 4c565b1 + 0ee3202 commit 5b3881e

File tree

1 file changed

+34
-25
lines changed

1 file changed

+34
-25
lines changed

sms-infrastructure/src/main/kotlin/team/msg/sms/global/security/SecurityConfig.kt

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,57 +45,66 @@ class SecurityConfig(
4545
.requestMatchers(RequestMatcher { request ->
4646
CorsUtils.isPreFlightRequest(request)
4747
}).permitAll()
48-
//healthCheck
48+
// Health
4949
.antMatchers(HttpMethod.GET, "/health").permitAll()
5050

51-
// auth
51+
// Auth
52+
.antMatchers(HttpMethod.GET, "/auth/verity/access").authenticated()
5253
.antMatchers(HttpMethod.POST, "/auth").permitAll()
5354
.antMatchers(HttpMethod.PATCH, "/auth").permitAll()
5455
.antMatchers(HttpMethod.DELETE, "/auth").authenticated()
55-
.antMatchers(HttpMethod.GET, "/auth/verity/access").authenticated()
5656
.antMatchers(HttpMethod.DELETE, "/auth/withdrawal").authenticated()
5757

58-
.antMatchers(HttpMethod.GET, "/user/profile/img").permitAll()
59-
.antMatchers(HttpMethod.GET, "/user/profile").hasAuthority(STUDENT)
60-
61-
.antMatchers(HttpMethod.POST, "/student").hasAuthority(STUDENT)
62-
.antMatchers(HttpMethod.GET, "/student").permitAll()
63-
.antMatchers(HttpMethod.POST, "/student/link").hasAuthority(TEACHER)
58+
// Student
6459
.antMatchers(HttpMethod.GET, "/student/link").permitAll()
6560
.antMatchers(HttpMethod.GET, "/student/{uuid}").hasAnyAuthority(STUDENT, TEACHER)
66-
.antMatchers(HttpMethod.PUT, "/student/pdf").hasAuthority(STUDENT)
6761
.antMatchers(HttpMethod.GET, "/student/anonymous/{uuid}").permitAll()
62+
.antMatchers(HttpMethod.GET, "/student/teacher/{uuid}").hasAuthority(TEACHER)
63+
.antMatchers(HttpMethod.GET, "/student").permitAll()
64+
.antMatchers(HttpMethod.PUT, "/student/pdf").hasAuthority(STUDENT)
65+
.antMatchers(HttpMethod.PUT, "/student").hasAuthority(STUDENT)
66+
.antMatchers(HttpMethod.POST, "/student").hasAuthority(STUDENT)
67+
.antMatchers(HttpMethod.POST, "/student/link").hasAuthority(TEACHER)
6868

69+
// Teacher
6970
.antMatchers(HttpMethod.POST, "/teacher/common").hasAuthority(TEACHER)
7071
.antMatchers(HttpMethod.POST, "/teacher/director").hasAuthority(TEACHER)
7172
.antMatchers(HttpMethod.POST, "/teacher/homeroom").hasAuthority(TEACHER)
7273
.antMatchers(HttpMethod.POST, "/teacher/principal").hasAuthority(TEACHER)
7374
.antMatchers(HttpMethod.POST, "/teacher/deputy-principal").hasAuthority(TEACHER)
7475

76+
// File
77+
.antMatchers(HttpMethod.POST, "/file").authenticated()
78+
.antMatchers(HttpMethod.POST, "/file/image").authenticated()
79+
80+
// Major
81+
.antMatchers(HttpMethod.GET, "/major/list").permitAll()
82+
83+
// Stack
84+
.antMatchers(HttpMethod.GET, "/stack/list").permitAll()
85+
86+
// User
87+
.antMatchers(HttpMethod.GET, "/user/profile/img").permitAll()
88+
.antMatchers(HttpMethod.GET, "/user/profile").hasAuthority(STUDENT)
89+
90+
// Authentication
7591
.antMatchers(HttpMethod.GET, "/authentication/student/{student_uuid}").hasAuthority(TEACHER)
7692
.antMatchers(HttpMethod.GET, "/authentication/teacher").hasAuthority(TEACHER)
77-
.antMatchers(HttpMethod.PATCH, "/authentication/teacher/{uuid}/approve").hasAuthority(TEACHER)
78-
.antMatchers(HttpMethod.PATCH, "/authentication/teacher/{uuid}/reject").hasAuthority(TEACHER)
7993
.antMatchers(HttpMethod.GET, "/authentication/teacher/{uuid}").hasAuthority(TEACHER)
8094
.antMatchers(HttpMethod.GET, "/authentication/{uuid}/history").hasAnyAuthority(STUDENT, TEACHER)
8195
.antMatchers(HttpMethod.GET, "/authentication/my").hasAuthority(STUDENT)
82-
.antMatchers(HttpMethod.POST, "/authentication").hasAuthority(STUDENT)
8396
.antMatchers(HttpMethod.GET, "/authentication/{uuid}").hasAuthority(STUDENT)
84-
.antMatchers(HttpMethod.DELETE, "/authentication/{uuid}").hasAuthority(STUDENT)
85-
.antMatchers(HttpMethod.PATCH, "/authentication/{uuid}").hasAuthority(STUDENT)
86-
.antMatchers(HttpMethod.PUT, "/authentication/{uuid}").hasAuthority(STUDENT)
8797
.antMatchers(HttpMethod.GET, "/").hasAnyAuthority(STUDENT, TEACHER)
88-
.antMatchers(HttpMethod.POST, "/authentication/submit/{uuid}").hasAuthority(STUDENT)
89-
.antMatchers(HttpMethod.POST, "/authentication/create").hasAuthority(TEACHER)
9098
.antMatchers(HttpMethod.GET, "/authentication/form/{uuid}").hasAnyAuthority(STUDENT, TEACHER)
9199
.antMatchers(HttpMethod.GET, "/authentication").hasAuthority(TEACHER)
92-
93-
.antMatchers(HttpMethod.POST, "/file").authenticated()
94-
.antMatchers(HttpMethod.POST, "/file/image").authenticated()
95-
96-
.antMatchers(HttpMethod.GET, "/major/list").permitAll()
97-
98-
.antMatchers(HttpMethod.GET, "/stack/list").permitAll()
100+
.antMatchers(HttpMethod.PUT, "/authentication/{uuid}").hasAuthority(STUDENT)
101+
.antMatchers(HttpMethod.POST, "/authentication").hasAuthority(STUDENT)
102+
.antMatchers(HttpMethod.POST, "/authentication/submit/{uuid}").hasAuthority(STUDENT)
103+
.antMatchers(HttpMethod.POST, "/authentication/create").hasAuthority(TEACHER)
104+
.antMatchers(HttpMethod.PATCH, "/authentication/teacher/{uuid}/approve").hasAuthority(TEACHER)
105+
.antMatchers(HttpMethod.PATCH, "/authentication/teacher/{uuid}/reject").hasAuthority(TEACHER)
106+
.antMatchers(HttpMethod.PATCH, "/authentication/{uuid}").hasAuthority(STUDENT)
107+
.antMatchers(HttpMethod.DELETE, "/authentication/{uuid}").hasAuthority(STUDENT)
99108

100109
.anyRequest().denyAll()
101110

0 commit comments

Comments
 (0)