-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include information about -parameters flag in 6.2 upgrade notes
Closes gh-13552
- Loading branch information
1 parent
4c77a55
commit 5ceea9e
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
= Authorization Changes | ||
|
||
The following sections relate to how to adapt to changes in the authorization support. | ||
|
||
== Method Security | ||
|
||
[[compile-with-parameters]] | ||
=== Compile With `-parameters` | ||
|
||
Spring Framework 6.1 https://github.com/spring-projects/spring-framework/issues/29559[removes LocalVariableTableParameterNameDiscoverer]. | ||
This affects how `@PreAuthorize` and other xref:servlet/authorization/method-security.adoc[method security] annotations will process parameter names. | ||
If you are using method security annotations with parameter names, for example: | ||
|
||
[source,java] | ||
.Method security annotation using `id` parameter name | ||
---- | ||
@PreAuthorize("@authz.checkPermission(#id, authentication)") | ||
public void doSomething(Long id) { | ||
// ... | ||
} | ||
---- | ||
|
||
You must compile with `-parameters` to ensure that the parameter names are available at runtime. | ||
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]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters