feat:(REQ-2545) 修改缓存策略,兼容历史接口只传企业项目端的情况

This commit is contained in:
lilong 2024-07-24 11:40:17 +08:00
parent 88454399a8
commit 07908cb19c

View File

@ -963,18 +963,6 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
return result;
}
Set<String> terminals = req.getTerminal() == null ? null : new HashSet<>(req.getTerminal());
Set<Long> workspaceTypes = Sets.newHashSet();
// 历史接口会只给NT_CMS_WEB_PROJNT_CMS_WEB_ENT_ZB查询但是为了兼容新老版本的权限需要补充新版本的项目的权限code
if (!CollectionUtil.isEmpty(terminals)) {
if (terminals.contains("NT_CMS_WEB_PROJ")) {
workspaceTypes.add(Long.valueOf(WorkspaceTypeCodeEnum.GENERAL_PROJECT.getCode()));
}
if (terminals.contains("NT_CMS_WEB_ENT_ZB")) {
workspaceTypes.add(Long.valueOf(WorkspaceTypeCodeEnum.GENERAL_ENT.getCode()));
}
}
permissions.forEach(permission -> {
List<IdentityAuthRes.PermissionPoint> filterPermission = permission.getPermissionPoint().stream()
.filter(p -> {
@ -988,10 +976,7 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
// 历史接口会只给NT_CMS_WEB_PROJNT_CMS_WEB_ENT_ZB查询但是为了兼容新老版本的权限需要补充新版本的项目的权限code
if (terminals.contains("NT_CMS_WEB_PROJ") || terminals.contains("NT_CMS_WEB_ENT_ZB")) {
if (!Objects.equals(p.getTerminal(), "NT_CMS_WEB_GENERAL")) {
return false;
}
return workspaceTypes.contains(p.getWorkspaceType());
return Objects.equals(p.getTerminal(), "NT_CMS_WEB_GENERAL");
}
return false;
})