fix(数据集): 列权限错误

This commit is contained in:
taojinlong 2022-08-01 18:02:43 +08:00
parent 0d7f4bb235
commit 94b9cbbf6c

View File

@ -175,7 +175,6 @@ public class PermissionService {
dataSetColumnPermissionsDTO.setAuthTargetIds(Collections.singletonList(userId));
dataSetColumnPermissionsDTO.setAuthTargetType("user");
datasetColumnPermissions.addAll(columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO));
if(CollectionUtils.isNotEmpty(roleIds)){
dataSetColumnPermissionsDTO.setAuthTargetIds(roleIds);
dataSetColumnPermissionsDTO.setAuthTargetType("role");
@ -183,7 +182,7 @@ public class PermissionService {
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
columnPermissionsDTO.getWhiteListUser();
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {}.getType());
if(CollectionUtils.isNotEmpty(userIdList) && !userIdList.contains(userId)){
if(CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)){
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
}
}
@ -196,7 +195,7 @@ public class PermissionService {
List<DataSetColumnPermissionsDTO> deptColumnPermissionsDTOS = new ArrayList<>();
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {}.getType());
if(CollectionUtils.isNotEmpty(userIdList) && !userIdList.contains(userId)){
if(CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)){
deptColumnPermissionsDTOS.add(columnPermissionsDTO);
}
}