Skip to content

Commit 5ceea9e

Browse files
Include information about -parameters flag in 6.2 upgrade notes
Closes gh-13552
1 parent 4c77a55 commit 5ceea9e

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Diff for: docs/modules/ROOT/nav.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* xref:migration-7/index.adoc[Preparing for 7.0]
66
** xref:migration-7/configuration.adoc[Configuration]
77
* xref:migration/index.adoc[Migrating to 6.2]
8+
** xref:migration/authorization.adoc[Authorization Changes]
89
* xref:getting-spring-security.adoc[Getting Spring Security]
910
* xref:features/index.adoc[Features]
1011
** xref:features/authentication/index.adoc[Authentication]

Diff for: docs/modules/ROOT/pages/migration/authorization.adoc

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
= Authorization Changes
2+
3+
The following sections relate to how to adapt to changes in the authorization support.
4+
5+
== Method Security
6+
7+
[[compile-with-parameters]]
8+
=== Compile With `-parameters`
9+
10+
Spring Framework 6.1 https://github.com/spring-projects/spring-framework/issues/29559[removes LocalVariableTableParameterNameDiscoverer].
11+
This affects how `@PreAuthorize` and other xref:servlet/authorization/method-security.adoc[method security] annotations will process parameter names.
12+
If you are using method security annotations with parameter names, for example:
13+
14+
[source,java]
15+
.Method security annotation using `id` parameter name
16+
----
17+
@PreAuthorize("@authz.checkPermission(#id, authentication)")
18+
public void doSomething(Long id) {
19+
// ...
20+
}
21+
----
22+
23+
You must compile with `-parameters` to ensure that the parameter names are available at runtime.
24+
For more information about this, please visit the https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#core-container[Upgrading to Spring Framework 6.1 page].

Diff for: docs/modules/ROOT/pages/migration/index.adoc

+6
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ Next, you should ensure you are on the latest patch release of Spring Security 6
1515
Typically, the latest patch release of Spring Boot uses the latest patch release of Spring Security.
1616

1717
With those two steps complete, you can now update to Spring Security 6.2.
18+
19+
== Quick Reference
20+
21+
The following list provide a quick reference for the changes that are described in this guide.
22+
23+
- xref:migration/authorization.adoc#compile-with-parameters[You are using method parameter names in `@PreAuthorize`, `@PostAuthorize`, or any other method security annotations]

0 commit comments

Comments
 (0)