You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-7/authorization.adoc
+79Lines changed: 79 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,3 +22,82 @@ public void doSomething(Long id) {
22
22
23
23
You must compile with `-parameters` to ensure that the parameter names are available at runtime.
24
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].
25
+
26
+
=== Favor `AnnotationTemplateExpressionDefaults` over `PrePostTemplateDefaults`
27
+
28
+
In Spring Security 7, `AnnotationTemplateExpressionDefaults` will be included by default.
29
+
30
+
If you are customizing `PrePostTemplateDefaults` or simply want to see how your application responds to `AnnotationTemplateExpressionDefaults`, you can publish an `AnnotationTemplateExpressionDefaults` bean instead of a `PrePostTemplateDefaults` method:
If you are publishing an `AuthorizationAdvisor` bean, like `AuthorizationManagerBeforeMethodInterceptor`, `AuthorizationManagerAfterMethodInterceptor`, `PreFilterAuthorizationMethodInterceptor`, or `PostFilterAuthorizationMethodInterceptor`, you can do the same by calling `setTemplateDefaults` with an `AnnotationTemplateExpressionDefaults` instance instead:
65
+
66
+
[tabs]
67
+
======
68
+
Java::
69
+
+
70
+
[source,java,role="primary"]
71
+
----
72
+
@Bean
73
+
@Role(BeanDescription.ROLE_INFRASTRUCTURE)
74
+
static Advisor preFilter() {
75
+
PreFilterAuthorizationMethodInterceptor interceptor = new PreFilterAuthorizationMethodInterceptor();
=== Publish `AuthorizationAdvisor` instances instead of adding them in a `Customizer<AuthorizationAdvisorProxyFactory>`
98
+
99
+
While the ability to customize the `AuthorizationAdvisorProxyFactory` instance will remain in Spring Security 7, the ability to add advisors will be removed in favor of picking up published `AuthorizationAdvisor` beans.
100
+
101
+
If you are not calling `AuthorizationAdvisorProxyFactory#setAdvisors` or `AuthorizationAdvisorProxyFactory#addAdvisor`, you need do nothing.
102
+
103
+
If you are, publish the `AuthorizationAdvisor` bean instead and Spring Security will pick it up and apply it automatically.
0 commit comments