@@ -45,57 +45,66 @@ class SecurityConfig(
45
45
.requestMatchers(RequestMatcher { request ->
46
46
CorsUtils .isPreFlightRequest(request)
47
47
}).permitAll()
48
- // healthCheck
48
+ // Health
49
49
.antMatchers(HttpMethod .GET , " /health" ).permitAll()
50
50
51
- // auth
51
+ // Auth
52
+ .antMatchers(HttpMethod .GET , " /auth/verity/access" ).authenticated()
52
53
.antMatchers(HttpMethod .POST , " /auth" ).permitAll()
53
54
.antMatchers(HttpMethod .PATCH , " /auth" ).permitAll()
54
55
.antMatchers(HttpMethod .DELETE , " /auth" ).authenticated()
55
- .antMatchers(HttpMethod .GET , " /auth/verity/access" ).authenticated()
56
56
.antMatchers(HttpMethod .DELETE , " /auth/withdrawal" ).authenticated()
57
57
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
64
59
.antMatchers(HttpMethod .GET , " /student/link" ).permitAll()
65
60
.antMatchers(HttpMethod .GET , " /student/{uuid}" ).hasAnyAuthority(STUDENT , TEACHER )
66
- .antMatchers(HttpMethod .PUT , " /student/pdf" ).hasAuthority(STUDENT )
67
61
.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 )
68
68
69
+ // Teacher
69
70
.antMatchers(HttpMethod .POST , " /teacher/common" ).hasAuthority(TEACHER )
70
71
.antMatchers(HttpMethod .POST , " /teacher/director" ).hasAuthority(TEACHER )
71
72
.antMatchers(HttpMethod .POST , " /teacher/homeroom" ).hasAuthority(TEACHER )
72
73
.antMatchers(HttpMethod .POST , " /teacher/principal" ).hasAuthority(TEACHER )
73
74
.antMatchers(HttpMethod .POST , " /teacher/deputy-principal" ).hasAuthority(TEACHER )
74
75
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
75
91
.antMatchers(HttpMethod .GET , " /authentication/student/{student_uuid}" ).hasAuthority(TEACHER )
76
92
.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 )
79
93
.antMatchers(HttpMethod .GET , " /authentication/teacher/{uuid}" ).hasAuthority(TEACHER )
80
94
.antMatchers(HttpMethod .GET , " /authentication/{uuid}/history" ).hasAnyAuthority(STUDENT , TEACHER )
81
95
.antMatchers(HttpMethod .GET , " /authentication/my" ).hasAuthority(STUDENT )
82
- .antMatchers(HttpMethod .POST , " /authentication" ).hasAuthority(STUDENT )
83
96
.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 )
87
97
.antMatchers(HttpMethod .GET , " /" ).hasAnyAuthority(STUDENT , TEACHER )
88
- .antMatchers(HttpMethod .POST , " /authentication/submit/{uuid}" ).hasAuthority(STUDENT )
89
- .antMatchers(HttpMethod .POST , " /authentication/create" ).hasAuthority(TEACHER )
90
98
.antMatchers(HttpMethod .GET , " /authentication/form/{uuid}" ).hasAnyAuthority(STUDENT , TEACHER )
91
99
.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 )
99
108
100
109
.anyRequest().denyAll()
101
110
0 commit comments