Fix critical issue with public datasets
This commit is contained in:
parent
aed23a655b
commit
19aa2bd411
|
@ -313,7 +313,7 @@ public class DashBoardManager {
|
|||
roles.add(UserDMP.UserDMPRoles.USER.getValue());
|
||||
roles.add(UserDMP.UserDMPRoles.OWNER.getValue());
|
||||
dmpList = dataManagementPlanRepository.getAuthenticated(dmpList, principal.getId(), roles);
|
||||
datasetList = datasetRepository.getAuthenticated(datasetList, user, roles);
|
||||
datasetList = datasetRepository.getAuthenticated(datasetList, user, roles).distinct();
|
||||
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,6 @@ public class DashBoardManager {
|
|||
|
||||
List<RecentActivityModel> recentDatasetModels = datasetList
|
||||
.withHint(HintedModelFactory.getHint(DatasetListingModel.class))
|
||||
.distinct()
|
||||
.select(item -> new RecentDatasetModel().fromEntity(item));
|
||||
recentActivityModels.addAll(recentDatasetModels);
|
||||
}/*);*/
|
||||
|
|
|
@ -186,6 +186,7 @@ public class DataManagementPlanManager {
|
|||
DatasetCriteria datasetCriteria = new DatasetCriteria();
|
||||
datasetCriteria.setDmpIds(Collections.singletonList(dmp.getId()));
|
||||
datasetCriteria.setAllVersions(false);
|
||||
datasetCriteria.setIsPublic(dataManagementPlanTableRequest.getCriteria().getIsPublic());
|
||||
dmp.setDataset(retrieveRelevantDatasets(datasetCriteria, principalID));
|
||||
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ public class DatasetManager {
|
|||
if (datasetTableRequest.getCriteria().getRole() != null) {
|
||||
roles.add(datasetTableRequest.getCriteria().getRole());
|
||||
}
|
||||
authItems = databaseRepository.getDatasetDao().getAuthenticated(items, userInfo, roles);
|
||||
authItems = databaseRepository.getDatasetDao().getAuthenticated(items, userInfo, roles).distinct();
|
||||
pagedItems = PaginationManager.applyPaging(authItems, datasetTableRequest);
|
||||
} else {
|
||||
if (principal.getId() != null && datasetTableRequest.getCriteria().getRole() != null) {
|
||||
|
@ -210,9 +210,9 @@ public class DatasetManager {
|
|||
DataTableData<DatasetListingModel> dataTable = new DataTableData<>();
|
||||
|
||||
|
||||
dataTable.setData(pagedItems.distinct().select(this::mapModel).stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
dataTable.setData(pagedItems.select(this::mapModel).stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
|
||||
dataTable.setTotalCount(authItems.distinct().count());
|
||||
dataTable.setTotalCount(authItems.count());
|
||||
|
||||
//CompletableFuture.allOf(itemsFuture, countFuture).join();
|
||||
return dataTable;
|
||||
|
|
Loading…
Reference in New Issue