Fixes bug on DMP listing backend logic that exposes deleted Datasets.

This commit is contained in:
gkolokythas 2019-05-13 12:20:59 +03:00
parent 5b6936c25e
commit 1747e62a58
1 changed files with 6 additions and 3 deletions

View File

@ -96,10 +96,13 @@ public class DataManagementPlanManager {
.selectAsync(item -> { .selectAsync(item -> {
item.setDataset( item.setDataset(
item.getDataset().stream() item.getDataset().stream()
.filter(ds -> !ds.getStatus().equals(Dataset.Status.DELETED.getValue())).collect(Collectors.toList()).stream()
.filter(dataset -> dataset.getDmp().getCreator().getId().equals(principalID) .filter(dataset -> dataset.getDmp().getCreator().getId().equals(principalID)
|| dataset.isPublic() || dataset.isPublic()
|| dataset.getDmp().getUsers().stream() || dataset.getDmp().getUsers().stream()
.filter(x -> x.getUser().getId().equals(principalID)).collect(Collectors.toList()).size() > 0).collect(Collectors.toSet())); .filter(x -> x.getUser().getId().equals(principalID))
.collect(Collectors.toList()).size() > 0)
.collect(Collectors.toSet()));
return new DataManagementPlanListingModel().fromDataModelDatasets(item); return new DataManagementPlanListingModel().fromDataModelDatasets(item);
}) })
.whenComplete((resultList, throwable) -> dataTable.setData(resultList)); .whenComplete((resultList, throwable) -> dataTable.setData(resultList));