forked from github/dataease
Merge pull request #1336 from dataease/pr@dev@fix_auth_tree
feat(权限): 统一授权数据集tree
This commit is contained in:
commit
83f69f0804
@ -27,14 +27,16 @@ public class VAuthModelService {
|
|||||||
public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request) {
|
public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request) {
|
||||||
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request);
|
List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request);
|
||||||
|
// 定时任务选数据集时,列表需去除空目录
|
||||||
|
if (request.isClearEmptyDir()) {
|
||||||
result = filterData(request, result);
|
result = filterData(request, result);
|
||||||
List<VAuthModelDTO> vAuthModelDTOS = TreeUtils.mergeTree(result);
|
List<VAuthModelDTO> vAuthModelDTOS = TreeUtils.mergeTree(result);
|
||||||
if (request.isClearEmptyDir()) {
|
|
||||||
setAllLeafs(vAuthModelDTOS);
|
setAllLeafs(vAuthModelDTOS);
|
||||||
removeEmptyDir(vAuthModelDTOS);
|
removeEmptyDir(vAuthModelDTOS);
|
||||||
}
|
|
||||||
return vAuthModelDTOS;
|
return vAuthModelDTOS;
|
||||||
}
|
}
|
||||||
|
return TreeUtils.mergeTree(result);
|
||||||
|
}
|
||||||
|
|
||||||
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) {
|
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) {
|
||||||
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {
|
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user