Modified to support changes to interface.

This commit is contained in:
Ben Alex 2004-04-02 11:56:00 +00:00
parent cfb99d01c9
commit 8c69eb6abb
1 changed files with 16 additions and 1 deletions

View File

@ -55,8 +55,23 @@ public class ContactSecurityVoter implements AccessDecisionVoter {
}
}
public int vote(Authentication authentication, MethodInvocation invocation,
public boolean supports(Class clazz) {
if (MethodInvocation.class.isAssignableFrom(clazz)) {
return true;
} else {
return false;
}
}
public int vote(Authentication authentication, Object object,
ConfigAttributeDefinition config) {
if ((object == null) || !this.supports(object.getClass())) {
throw new IllegalArgumentException(
"Does not support the presented Object type");
}
MethodInvocation invocation = (MethodInvocation) object;
int result = ACCESS_ABSTAIN;
Iterator iter = config.getConfigAttributes();