From a386094ffacd1cbdad4ee8bab18eabb3b2962bc8 Mon Sep 17 00:00:00 2001 From: octopus <912554887@qq.com> Date: Mon, 2 Sep 2024 16:42:43 +0800 Subject: [PATCH] fixed the dataset permissions field query by the listDataset is null --- .../components/dataset/service/DatasetServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wedpr-components/dataset/src/main/java/com/webank/wedpr/components/dataset/service/DatasetServiceImpl.java b/wedpr-components/dataset/src/main/java/com/webank/wedpr/components/dataset/service/DatasetServiceImpl.java index 2025d8dc..b3f54f6b 100644 --- a/wedpr-components/dataset/src/main/java/com/webank/wedpr/components/dataset/service/DatasetServiceImpl.java +++ b/wedpr-components/dataset/src/main/java/com/webank/wedpr/components/dataset/service/DatasetServiceImpl.java @@ -532,6 +532,16 @@ public ListDatasetResponse listDataset( startTime, endTime); + if (!datasetList.isEmpty()) { + for (Dataset dataset : datasetList) { + String datasetId = dataset.getDatasetId(); + DatasetUserPermissions datasetUserPermissions = + DatasetUserPermissionValidator.confirmUserDatasetPermissions( + datasetId, userInfo, datasetPermissionMapper, false); + dataset.setPermissions(datasetUserPermissions); + } + } + long totalCount = new PageInfo<>(datasetList).getTotal(); long pageEndOffset = (long) pageNum * pageSize; boolean isLast = (pageEndOffset >= totalCount);