feat:(REQ-2545) 有指定unicode时,就不过滤菜单,

This commit is contained in:
lilong 2024-07-09 19:35:07 +08:00
parent 9ea27b3051
commit 4d0ae63e4b
2 changed files with 16 additions and 4 deletions

View File

@ -25,7 +25,7 @@ public class ProductFeatureQuery {
private Integer workspaceJoinType;
//
// private Set<Long> featureIds;
private Set<Long> featureIds;
/**
* 菜单资源数节点类型

View File

@ -19,6 +19,7 @@ import cn.axzo.tyr.client.model.base.FeatureResourceExtraDO;
import cn.axzo.tyr.client.model.base.WorkspaceOUPair;
import cn.axzo.tyr.client.model.enums.IdentityType;
import cn.axzo.tyr.client.model.product.ProductFeatureRelationVO;
import cn.axzo.tyr.client.model.req.FeatureIdPair;
import cn.axzo.tyr.client.model.req.IdentityAuthReq;
import cn.axzo.tyr.client.model.req.NavTreeReq;
import cn.axzo.tyr.client.model.req.PagePermissionReq;
@ -307,7 +308,9 @@ public class PermissionQueryServiceImpl implements PermissionQueryService {
.build());
// 有可能存在资源树被删除的情况
// 因为会存在用户只有菜单权限下面没有节点这种需要过滤掉
saasFeatureResources = filterFeature(saasFeatureResources);
if (StringUtils.isBlank(req.getUniCode())) {
saasFeatureResources = filterFeature(saasFeatureResources);
}
if (CollectionUtils.isEmpty(saasFeatureResources)) {
return Collections.emptyList();
}
@ -608,7 +611,7 @@ public class PermissionQueryServiceImpl implements PermissionQueryService {
List<SaasRoleUserV2DTO> saasRoleUserV2DTOS = listUserPermission(treePermissionReq, featureIds);
List<WorkspaceProductService.WorkspaceProduct> workspaceProducts = listWorkspaceProducts(treePermissionReq);
List<WorkspaceProductService.WorkspaceProduct> workspaceProducts = listWorkspaceProducts(treePermissionReq, featureIds);
//免授权
List<Long> authFreeFeatureIds = listNotAuthFeatures(treePermissionReq);
@ -627,17 +630,26 @@ public class PermissionQueryServiceImpl implements PermissionQueryService {
.collect(Collectors.toList());
}
private List<WorkspaceProductService.WorkspaceProduct> listWorkspaceProducts(TreePermissionReq treePermissionReq) {
private List<WorkspaceProductService.WorkspaceProduct> listWorkspaceProducts(TreePermissionReq treePermissionReq,
List<Long> featureIds) {
//查询租户产品权限点
Set<Long> workspaceIds = treePermissionReq.getWorkspaceOUPairs().stream()
.map(WorkspaceOUPair::getWorkspaceId)
.collect(Collectors.toSet());
WorkspaceProductService.WorkspaceProductParam workspaceProductParam = WorkspaceProductService.WorkspaceProductParam.builder()
.terminal(treePermissionReq.getTerminal())
.workspaceIds(workspaceIds)
.featureResourceTypes(treePermissionReq.getFeatureResourceTypes())
.type(NEW_FEATURE)
.build();
if (CollectionUtils.isNotEmpty(featureIds)) {
workspaceProductParam.setFeatureIdPairs(Lists.newArrayList(FeatureIdPair.builder()
.featureIds(Sets.newHashSet(featureIds))
.type(NEW_FEATURE)
.build()));
}
return workspaceProductService.listWorkspaceProduct(workspaceProductParam);
}