From 63d2f19e2a40321be631cd08d5687271e55eef22 Mon Sep 17 00:00:00 2001 From: Yuriy Savchenko Date: Wed, 20 Jul 2022 16:04:14 +0300 Subject: [PATCH] Remove default value for access parameter Closes gh-10957 --- .../config/annotation/web/AuthorizeRequestsDsl.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt index 53fa7b7a01..cb016d0917 100644 --- a/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt +++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt @@ -46,7 +46,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * (i.e. "hasAuthority('ROLE_USER') and hasAuthority('ROLE_SUPER')") */ fun authorize(matches: RequestMatcher = AnyRequestMatcher.INSTANCE, - access: String = "authenticated") { + access: String) { authorizationRules.add(MatcherAuthorizationRule(matches, access)) } @@ -65,7 +65,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * @param access the SpEL expression to secure the matching request * (i.e. "hasAuthority('ROLE_USER') and hasAuthority('ROLE_SUPER')") */ - fun authorize(pattern: String, access: String = "authenticated") { + fun authorize(pattern: String, access: String) { authorizationRules.add(PatternAuthorizationRule(pattern = pattern, patternType = PATTERN_TYPE, rule = access)) @@ -87,7 +87,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * @param access the SpEL expression to secure the matching request * (i.e. "hasAuthority('ROLE_USER') and hasAuthority('ROLE_SUPER')") */ - fun authorize(method: HttpMethod, pattern: String, access: String = "authenticated") { + fun authorize(method: HttpMethod, pattern: String, access: String) { authorizationRules.add(PatternAuthorizationRule(pattern = pattern, patternType = PATTERN_TYPE, httpMethod = method, @@ -111,7 +111,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * @param access the SpEL expression to secure the matching request * (i.e. "hasAuthority('ROLE_USER') and hasAuthority('ROLE_SUPER')") */ - fun authorize(pattern: String, servletPath: String, access: String = "authenticated") { + fun authorize(pattern: String, servletPath: String, access: String) { authorizationRules.add(PatternAuthorizationRule(pattern = pattern, patternType = PATTERN_TYPE, servletPath = servletPath, @@ -136,7 +136,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * @param access the SpEL expression to secure the matching request * (i.e. "hasAuthority('ROLE_USER') and hasAuthority('ROLE_SUPER')") */ - fun authorize(method: HttpMethod, pattern: String, servletPath: String, access: String = "authenticated") { + fun authorize(method: HttpMethod, pattern: String, servletPath: String, access: String) { authorizationRules.add(PatternAuthorizationRule(pattern = pattern, patternType = PATTERN_TYPE, servletPath = servletPath,