use of com.epam.ta.reportportal.database.entity.ProjectRole in project commons-dao by reportportal.
the class ProjectRepositoryCustomImpl method findProjectRoles.
@Override
public Map<String, ProjectRole> findProjectRoles(String login) {
final Query q = Query.query(userExists(login));
q.fields().include("users");
return mongoTemplate.find(q, Project.class).stream().collect(Collectors.toMap(Project::getName, p -> p.getUsers().stream().filter(it -> login.equals(it.getLogin())).findFirst().get().getProjectRole()));
}
Aggregations