if (identity.isLoggedIn()) {
RelationshipQuery<Grant> query =
relationshipManager.createRelationshipQuery(Grant.class);
query.setParameter(Grant.ASSIGNEE, identity.getAccount());
for (final Grant grant : query.getResultList()) {
roles.add(new Role(grant.getRole().getName()));
}
}
return roles;
}