Fixes bug on Dataset listing when user not creator.

This commit is contained in:
gkolokythas 2019-05-15 17:43:53 +03:00
parent b13bbdb670
commit bb3fb91ba8
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
public QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal) {
if (principal.getId() == null) query.where((builder, root) -> builder.equal(root.get("isPublic"), true));
else {
query.where((builder, root) -> builder.or(builder.equal(root.get("dmp").get("creator"), principal), builder.equal(root.join("dmp").join("users", JoinType.LEFT).get("id"), principal.getId())));
query.where((builder, root) -> builder.or(builder.equal(root.get("dmp").get("creator"), principal), builder.equal(root.join("dmp", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal.getId())));
}
return query;
}