Skip to content

Commit 3016ed0

Browse files
ysavchenjzheaux
authored andcommitted
Fix typos in Kotlin DSL docs
Issue gh-10481
1 parent 7deaab8 commit 3016ed0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

config/src/main/kotlin/org/springframework/security/config/web/servlet/AuthorizeRequestsDsl.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
5454
* Adds a request authorization rule for an endpoint matching the provided
5555
* pattern.
5656
* If Spring MVC is on the classpath, it will use an MVC matcher.
57-
* If Spring MVC is not an the classpath, it will use an ant matcher.
57+
* If Spring MVC is not on the classpath, it will use an ant matcher.
5858
* The MVC will use the same rules that Spring MVC uses for matching.
5959
* For example, often times a mapping of the path "/path" will match on
6060
* "/path", "/path/", "/path.html", etc.
@@ -75,7 +75,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
7575
* Adds a request authorization rule for an endpoint matching the provided
7676
* pattern.
7777
* If Spring MVC is on the classpath, it will use an MVC matcher.
78-
* If Spring MVC is not an the classpath, it will use an ant matcher.
78+
* If Spring MVC is not on the classpath, it will use an ant matcher.
7979
* The MVC will use the same rules that Spring MVC uses for matching.
8080
* For example, often times a mapping of the path "/path" will match on
8181
* "/path", "/path/", "/path.html", etc.
@@ -98,7 +98,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
9898
* Adds a request authorization rule for an endpoint matching the provided
9999
* pattern.
100100
* If Spring MVC is on the classpath, it will use an MVC matcher.
101-
* If Spring MVC is not an the classpath, it will use an ant matcher.
101+
* If Spring MVC is not on the classpath, it will use an ant matcher.
102102
* The MVC will use the same rules that Spring MVC uses for matching.
103103
* For example, often times a mapping of the path "/path" will match on
104104
* "/path", "/path/", "/path.html", etc.
@@ -122,7 +122,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
122122
* Adds a request authorization rule for an endpoint matching the provided
123123
* pattern.
124124
* If Spring MVC is on the classpath, it will use an MVC matcher.
125-
* If Spring MVC is not an the classpath, it will use an ant matcher.
125+
* If Spring MVC is not on the classpath, it will use an ant matcher.
126126
* The MVC will use the same rules that Spring MVC uses for matching.
127127
* For example, often times a mapping of the path "/path" will match on
128128
* "/path", "/path/", "/path.html", etc.
@@ -154,7 +154,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
154154
fun hasAuthority(authority: String) = "hasAuthority('$authority')"
155155

156156
/**
157-
* Specify that URLs requires any of a number authorities.
157+
* Specify that URLs require any number of authorities.
158158
*
159159
* @param authorities the authorities to require (i.e. ROLE_USER, ROLE_ADMIN, etc).
160160
* @return the SpEL expression "hasAnyAuthority" with the given authorities as a
@@ -175,7 +175,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
175175
fun hasRole(role: String) = "hasRole('$role')"
176176

177177
/**
178-
* Specify that URLs requires any of a number roles.
178+
* Specify that URLs require any number of roles.
179179
*
180180
* @param roles the roles to require (i.e. USER, ADMIN, etc).
181181
* @return the SpEL expression "hasAnyRole" with the given roles as a

config/src/main/kotlin/org/springframework/security/config/web/servlet/HttpSecurityDsl.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,8 +38,8 @@ import javax.servlet.http.HttpServletRequest
3838
* override fun configure(http: HttpSecurity) {
3939
* http {
4040
* authorizeRequests {
41-
* request("/public", permitAll)
42-
* request(anyRequest, authenticated)
41+
* authorize("/public", permitAll)
42+
* authorize(anyRequest, authenticated)
4343
* }
4444
* formLogin {
4545
* loginPage = "/log-in"
@@ -181,8 +181,8 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
181181
* override fun configure(http: HttpSecurity) {
182182
* http {
183183
* authorizeRequests {
184-
* request("/public", permitAll)
185-
* request(anyRequest, authenticated)
184+
* authorize("/public", permitAll)
185+
* authorize(anyRequest, authenticated)
186186
* }
187187
* }
188188
* }

0 commit comments

Comments
 (0)