feat: (feature/REQ-2595) 菜单权限查询,处理用户只有免授权权限但是没有查询到父节点的问题

This commit is contained in:
lilong 2024-11-08 15:42:59 +08:00
parent 037e466c73
commit 6238ff81d6

View File

@ -787,7 +787,14 @@ public class PermissionQueryServiceImpl implements PermissionQueryService {
//免授权
Set<Long> authFreeFeatureIds = allFeatureResources.stream()
.filter(e -> BooleanUtils.isTrue(e.isNotAuth()))
.map(SaasFeatureResourceService.SaasFeatureResourceCache::getFeatureId)
.flatMap(e -> {
Set<Long> parentIds = e.getParentIds();
if (CollectionUtils.isEmpty(parentIds)) {
return Sets.newHashSet(e.getFeatureId()).stream();
}
parentIds.add(e.getFeatureId());
return parentIds.stream();
})
.collect(Collectors.toSet());
Set<Long> allFeatureIds = allFeatureResources.stream()