GrantedAuthority[] authorities =
new GrantedAuthorityImpl[userData.getRoles().size()];
int i = 0;
for (Iterator it = userData.getRoles().iterator(); it.hasNext();) {
UserRole role = (UserRole)it.next();
authorities[i++] = new GrantedAuthorityImpl(role.getRole());
}
return new org.acegisecurity.userdetails.User(
userData.getUserName(), userData.getPassword(), true, authorities);
}