Fixed TestVoter to match recent API updates

This commit is contained in:
Luke Taylor 2008-11-10 04:12:53 +00:00
parent d6cd392a9e
commit fa6f57e3dd
1 changed files with 14 additions and 14 deletions

View File

@ -1,30 +1,30 @@
package sample;
import java.lang.annotation.Annotation;
import java.util.List;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.ConfigAttributeDefinition;
import org.springframework.security.vote.AccessDecisionVoter;
public class TestVoter implements AccessDecisionVoter {
public boolean supports(ConfigAttribute attribute) {
return true;
}
public boolean supports(ConfigAttribute attribute) {
return true;
}
public boolean supports(Class clazz) {
return MethodInvocation.class.isAssignableFrom(clazz);
}
public boolean supports(Class clazz) {
return MethodInvocation.class.isAssignableFrom(clazz);
}
public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config) {
MethodInvocation mi = (MethodInvocation) object;
Annotation[][] annotations = mi.getMethod().getParameterAnnotations();
public int vote(Authentication authentication, Object object, List<ConfigAttribute> config) {
MethodInvocation mi = (MethodInvocation) object;
return ACCESS_GRANTED;
}
Annotation[][] annotations = mi.getMethod().getParameterAnnotations();
return ACCESS_GRANTED;
}
}