File tree 1 file changed +13
-12
lines changed
docs/modules/ROOT/pages/servlet/authorization 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -185,15 +185,15 @@ Java::
185
185
[source,java,role="primary"]
186
186
----
187
187
@Bean
188
- SecurityFilterChain web(HttpSecurity http) throws Exception {
189
- http
190
- .authorizeHttpRequests((authorize) -> authorize
191
- .requestMatchers("/endpoint").hasAuthority("USER")
192
- .anyRequest().authenticated()
193
- )
188
+ public SecurityFilterChain web(HttpSecurity http) throws Exception {
189
+ http
190
+ .authorizeHttpRequests((authorize) -> authorize
191
+ .requestMatchers("/endpoint").hasAuthority("USER")
192
+ .anyRequest().authenticated()
193
+ )
194
194
// ...
195
-
196
- return http.build();
195
+
196
+ return http.build();
197
197
}
198
198
----
199
199
@@ -202,14 +202,15 @@ Kotlin::
202
202
[source,kotlin,role="secondary"]
203
203
----
204
204
@Bean
205
- SecurityFilterChain web(HttpSecurity http) throws Exception {
206
- http {
205
+ fun web(http: HttpSecurity): SecurityFilterChain {
206
+ http {
207
207
authorizeHttpRequests {
208
208
authorize("/endpoint", hasAuthority("USER"))
209
209
authorize(anyRequest, authenticated)
210
210
}
211
- }
212
- return http.build();
211
+ }
212
+
213
+ return http.build()
213
214
}
214
215
----
215
216
You can’t perform that action at this time.
0 commit comments