resp.setRoles(new HashSet<String>(u.getRoles()));
responses.add(resp);
}
} else {
User u = users.getAnyUser(r.getUsername());
if (null == u) {
if (requests.size() == 1) {
// only throw exceptin if there is a single request
// if there are multiple requests, this indicates an OR predicate
throw new ObjectNotFoundException("Cannot find user '"
+ r.getUsername() + "'");
}
} else {
UserResponse resp = new UserResponse(u.getUserName(), u.isLdapUser());
resp.setRoles(new HashSet<String>(u.getRoles()));
responses.add(resp);
}
}
}