Commit a2d5c291 by guojuxing

应用操作项权限修复

parent 3476e935
...@@ -1120,6 +1120,8 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -1120,6 +1120,8 @@ public class MenuApiServiceImpl implements MenuApiService {
authItemIdList.add(menu.getMenuId()); authItemIdList.add(menu.getMenuId());
} }
} }
//如果是gic菜单,需要去判断版本code
boolean isNeedValidVersionCode = MenuProjectConstants.DEFAULT_PROJECT_CODE == projectCode;
List<MenuDTO> resultList = new ArrayList<>(); List<MenuDTO> resultList = new ArrayList<>();
Map<String, Object> operationItemMap = new HashMap<>(16); Map<String, Object> operationItemMap = new HashMap<>(16);
...@@ -1136,8 +1138,9 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -1136,8 +1138,9 @@ public class MenuApiServiceImpl implements MenuApiService {
//当时超级管理员的时候,operationItemMap是没有值的,因此会一直有效。 //当时超级管理员的时候,operationItemMap是没有值的,因此会一直有效。
if (CollectionUtils.isNotEmpty(operationItemListOfAuthItem)) { if (CollectionUtils.isNotEmpty(operationItemListOfAuthItem)) {
for (MenuDTO menuDTO : operationItemListOfAuthItem) { for (MenuDTO menuDTO : operationItemListOfAuthItem) {
if (!operationItemMap.containsKey(menuDTO.getMenuId().toString()) || StringUtils.isBlank(versionCode) if (!operationItemMap.containsKey(menuDTO.getMenuId().toString())
|| !menuDTO.getMenuVersion().contains("_" + versionCode + "_")) { || (isNeedValidVersionCode && StringUtils.isBlank(versionCode))
|| (isNeedValidVersionCode && !menuDTO.getMenuVersion().contains("_" + versionCode + "_"))) {
//如果不存在,或者操作项的版本不对 //如果不存在,或者操作项的版本不对
//则是没有权限的操作项 //则是没有权限的操作项
resultList.add(menuDTO); resultList.add(menuDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment