- if (userHome == null)
- throw new ArgeoException("No home found for user "
- + session.getUserID());
- GrantedAuthority[] authorities = {};
+
+ // retrieve remote roles
+ Node userProfile = JcrUtils.getUserProfile(session);
+ List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
+ if (userProfile.hasProperty(ArgeoNames.ARGEO_REMOTE_ROLES)) {
+ Value[] roles = userProfile.getProperty(
+ ArgeoNames.ARGEO_REMOTE_ROLES).getValues();
+ for (int i = 0; i < roles.length; i++)
+ authorities.add(new GrantedAuthorityImpl(roles[i]
+ .getString()));
+ }