feat:(REQ-2699) 菜单权限查询接口排除用户没有角色、项目没有产品

This commit is contained in:
lilong 2024-08-26 13:50:10 +08:00
parent ffd48916e5
commit 4eb23c307c

View File

@ -877,11 +877,17 @@ public class PermissionQueryServiceImpl implements PermissionQueryService {
}
List<SaasRoleUserV2DTO> saasRoleUsers = listUserPermission(treePermissionReq);
if (CollectionUtils.isEmpty(saasRoleUsers)) {
return Collections.emptySet();
}
Map<Long, List<RoleSaasFeatureResourceCacheService.SaasFeatureResourceDTO>> roleFeatureResourceMap = listRoleFeatureResource(saasRoleUsers, treePermissionReq);
List<WorkspaceProductService.WorkspaceProductFeatureSource> workspaceProductFeatureSources = listWorkspaceProducts(treePermissionReq);
if (CollectionUtils.isEmpty(workspaceProductFeatureSources)) {
return Collections.emptySet();
}
//免授权
Set<Long> authFreeFeatureIds = allFeatureResources.stream()
.filter(e -> BooleanUtils.isTrue(e.isNotAuth()))