privilegesFromRest.addAll(Collections2.transform(role.getPrivileges(), Functions.toStringFunction()));
}
final String[] authorityStringsAsArray = privilegesFromRest.toArray(new String[privilegesFromRest.size()]);
final List<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList(authorityStringsAsArray);
loadedUser = new SpringSecurityPrincipal(name, password, true, authorities, "principalFromRest.getUuid()");
} catch (final Exception repositoryProblem) {
throw new AuthenticationServiceException(repositoryProblem.getMessage(), repositoryProblem);
}
return loadedUser;