Tag: vote

Spring Security:AccessDecisionVoter

@Service public class MyVoter implements AccessDecisionVoter { @Override public boolean supports(ConfigAttribute attribute) { boolean myBool = false; return myBool; } @Override public boolean supports(Class clazz) { return clazz == Project.class; } @Override public int vote(Authentication authentication, Entity someEntity, Collection config) { return ACCESS_GRANTED; } } 你能解释一下,第一个支持方法应该如何工作? 无论我如何更改myBool,都会调用vote-method。 似乎只支持(Class clazz)对invokation有影响。 有任何想法吗? 编辑: @Configuration @EnableWebMvcSecurity public class […]