/*
* @see org.springframework.security.vote.RoleVoter#vote(org.springframework.security.Authentication, java.lang.Object, org.springframework.security.ConfigAttributeDefinition)
*/
@Override
public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config) {
UserDetailsImpl details = getUserDetails(authentication);
if (details == null) {
return ACCESS_DENIED;
}
GrantedAuthority[] authorities = details.getAuthorities();
for (Object obj : config.getConfigAttributes()) {
ConfigAttribute attribute = (ConfigAttribute) obj;
List<String> subAttibutes = StringHelper.toList(attribute.getAttribute(), ",");
if (subAttibutes.contains(Authority.ROLE_BOUSER) && details.getUser().getType() == UserType.BO) {
return ACCESS_GRANTED;
}
if (!supports(attribute)) {
continue;