1
0
mirror of synced 2026-08-04 17:27:13 +00:00

SEC-1576: Parameterize the secured object type in AccessDecisionVoter.

This commit is contained in:
Luke Taylor
2010-12-16 15:21:22 +00:00
parent 85d685f7d3
commit c8820166c8
13 changed files with 45 additions and 46 deletions
@@ -15,12 +15,12 @@ import org.springframework.security.web.FilterInvocation;
* @author Luke Taylor
* @since 3.0
*/
public class WebExpressionVoter implements AccessDecisionVoter {
public class WebExpressionVoter implements AccessDecisionVoter<FilterInvocation> {
private SecurityExpressionHandler<FilterInvocation> expressionHandler = new DefaultWebSecurityExpressionHandler();
public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) {
public int vote(Authentication authentication, FilterInvocation fi, Collection<ConfigAttribute> attributes) {
assert authentication != null;
assert object != null;
assert fi != null;
assert attributes != null;
WebExpressionConfigAttribute weca = findConfigAttribute(attributes);
@@ -29,7 +29,6 @@ public class WebExpressionVoter implements AccessDecisionVoter {
return ACCESS_ABSTAIN;
}
FilterInvocation fi = (FilterInvocation)object;
EvaluationContext ctx = expressionHandler.createEvaluationContext(authentication, fi);
return ExpressionUtils.evaluateAsBoolean(weca.getAuthorizeExpression(), ctx) ?