From f6902471fb0798e255dd56f8291a875f64164315 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 28 Jun 2012 10:49:29 -0500 Subject: [PATCH] SEC-1965: DefaultWebSecurityExpressionHandler is now passive from 3.0.x releases There were two issues that needed resolved - Since DefaultWebSecurityExpressionHandler no longer implemented WebSecurityExpressionHandler a bean lookup by type would not work. This caused failures in the JSF support. - The method createEvaluationContext needed to be explicitly defined on WebSecurityExpressionHandler since the parameterized type from the super interface is not preserved at compile time. Without explicitly defining the method any class compiled against a previous version would cause a NoSuchMethodException. --- .../expression/DefaultWebSecurityExpressionHandler.java | 3 ++- .../web/access/expression/WebSecurityExpressionHandler.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/main/java/org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java b/web/src/main/java/org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java index 3f73e101f5..26ac79f6fa 100644 --- a/web/src/main/java/org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java +++ b/web/src/main/java/org/springframework/security/web/access/expression/DefaultWebSecurityExpressionHandler.java @@ -12,7 +12,8 @@ import org.springframework.security.web.FilterInvocation; * @author Luke Taylor * @since 3.0 */ -public class DefaultWebSecurityExpressionHandler extends AbstractSecurityExpressionHandler { +@SuppressWarnings("deprecation") +public class DefaultWebSecurityExpressionHandler extends AbstractSecurityExpressionHandler implements WebSecurityExpressionHandler { private final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); diff --git a/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionHandler.java b/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionHandler.java index 70bb5e801c..f5e350059e 100644 --- a/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionHandler.java +++ b/web/src/main/java/org/springframework/security/web/access/expression/WebSecurityExpressionHandler.java @@ -1,8 +1,12 @@ package org.springframework.security.web.access.expression; +import org.springframework.expression.EvaluationContext; import org.springframework.security.access.expression.SecurityExpressionHandler; +import org.springframework.security.core.Authentication; import org.springframework.security.web.FilterInvocation; @Deprecated public interface WebSecurityExpressionHandler extends SecurityExpressionHandler { + + EvaluationContext createEvaluationContext(Authentication authentication, FilterInvocation invocation); }