应用授权修订
ci-userbase-service / build-and-push (push) Successful in 2m48s

This commit is contained in:
chenxing
2026-08-11 12:20:47 +08:00
parent ed07f380da
commit a8c0793a92
@@ -611,17 +611,14 @@ public class GroupAuthzService implements IGroupAuthzService {
allChainIds.addAll(chain);
}
// 3. 收集这些组已开通的应用
// 3. 收集「用户归属组 + 其祖先链」所有组已开通的应用并集。
// 安全:hasUserModulePermission 仍会判定 groupId(当前归属组)必须在 openedApps 链上(即归属组或其祖先开通应用),
// 不会出现“无组归属、父级未开”的越权;此处只是把过滤和写面板(GroupModuleTreeByCategory)联动对齐,
// 解决之前“管理员在组8面板勾了checked=true,但UserPermissionTree返回空”的对称bug。
Map<Integer, Set<Integer>> groupToApps = new HashMap<>();
Set<Integer> allAppIds = new LinkedHashSet<>();
for (Integer groupIdItem : selfGroupIds) {
List<SysGroupAppRel> appRels = sysGroupAppRelRepository.findByGroupId(groupIdItem);
Set<Integer> apps = new LinkedHashSet<>();
for (SysGroupAppRel rel : appRels) {
if (rel.getAppId() != null) {
apps.add(rel.getAppId());
}
}
Set<Integer> apps = collectAppIdsForAuthzScope(groupIdItem);
groupToApps.put(groupIdItem, apps);
allAppIds.addAll(apps);
}