Merge pull request #1336 from dataease/pr@dev@fix_auth_tree

feat(权限): 统一授权数据集tree
This commit is contained in:
XiaJunjie2020 2021-11-30 16:31:24 +08:00 committed by GitHub
commit 83f69f0804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,14 +27,16 @@ public class VAuthModelService {
public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request) {
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request);
// 定时任务选数据集时列表需去除空目录
if (request.isClearEmptyDir()) {
result = filterData(request, result);
List<VAuthModelDTO> vAuthModelDTOS = TreeUtils.mergeTree(result);
if (request.isClearEmptyDir()) {
setAllLeafs(vAuthModelDTOS);
removeEmptyDir(vAuthModelDTOS);
}
return vAuthModelDTOS;
}
return TreeUtils.mergeTree(result);
}
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) {
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {