@Transactional(readOnly = true)
public SyncopeUser getUserFromId(final Long userId)
throws NotFoundException, UnauthorizedRoleException {
if (userId == null) {
throw new NotFoundException("Null user id");
}
SyncopeUser user = userDAO.find(userId);
if (user == null) {
throw new NotFoundException("User " + userId);
}
if (!user.getUsername().equals(EntitlementUtil.getAuthenticatedUsername())) {
Set<Long> roleIds = user.getRoleIds();
Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());