paascloud/paascloud-master · warning · UacBizException
UAC10013007
UAC10013007
Error message
根菜单不能禁用
What it means
UacBizException UAC10013007 thrown by updateUacMenuStatusById when attempting to change the status of the root menu. The service loads the menu by id and, if its level equals MenuConstant.MENU_LEVEL_ROOT, refuses the operation because the root menu must always remain enabled. Message: '根菜单不能禁用' (root menu cannot be disabled).
Solutions
- Exclude the root menu (level == MENU_LEVEL_ROOT) from status-change operations in the caller.
- Hide the status toggle in the UI for rows whose level is root.
- If this is not meant to be the root, verify the menuId — you are likely passing the wrong id.
- Check uac_menu.level for the row with that id to confirm which menu you are targeting.
Example fix
// before: allow any menu to be status-toggled
menuList.forEach(m -> uacMenuService.updateUacMenuStatusById(m.getId(), status));
// after: skip the root menu
if (MenuConstant.MENU_LEVEL_ROOT.equals(menu.getLevel())) {
return; // root cannot be disabled
}
uacMenuService.updateUacMenuStatusById(menu.getId(), status); Defensive patterns
Strategy: validation
Validate before calling
UacMenu menu = uacMenuService.selectByKey(id);
if (menu != null && MenuConstant.MENU_LEVEL_ROOT.equals(menu.getLevel())) {
// skip or reject: root menu status cannot be changed
} Type guard
boolean isRootMenu(UacMenu menu) { return menu != null && MenuConstant.MENU_LEVEL_ROOT.equals(menu.getLevel()); } Try / catch
try {
uacMenuService.updateUacMenuStatusById(statusDto, loginAuthDto);
} catch (UacBizException e) {
if ("UAC10013007".equals(e.getCode())) { /* notify: root menu cannot be disabled */ }
throw e;
} Prevention
- Hide status toggles for root-level rows in the admin UI.
- Filter out root menus from bulk status-change scripts.
- Load the menu's level before issuing any status update.
When it happens
Trigger: Calling updateUacMenuStatusById(id, status) where the id refers to the root-level menu (level == MENU_LEVEL_ROOT), regardless of whether the requested status is ENABLE or DISABLE.
Common situations: UI exposing a disable/enable toggle on the root menu row by mistake; API-level scripts iterating all menus and toggling status without excluding the root; seed/migration data with an unexpected root-level menu id.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/9f22c550a79df6b5.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacMenuServiceImpl.java:335
ViewMenuVo menuVo = modelMapper.map(menu, ViewMenuVo.class);
if (parentMenu != null) {
menuVo.setParentMenuName(parentMenu.getMenuName());
}
return menuVo;
}
@Override
public void updateUacMenuStatusById(UacMenuStatusDto uacMenuStatusDto, LoginAuthDto loginAuthDto) {
Long id = uacMenuStatusDto.getId();
String status = uacMenuStatusDto.getStatus();
Preconditions.checkArgument(id != null, "菜单ID不能为空");
Preconditions.checkArgument(StringUtils.isNotEmpty(status), "菜单状态不能为空");
UacMenu uacMenuQuery = this.selectByKey(id);
if (MenuConstant.MENU_LEVEL_ROOT.equals(uacMenuQuery.getLevel())) {
throw new UacBizException(ErrorCodeEnum.UAC10013007);
}
// 要处理的菜单集合
List<UacMenu> menuList = Lists.newArrayList();
int result;
if (status.equals(UacMenuStatusEnum.DISABLE.getType())) {
// 获取菜单以及子菜单
menuList = this.getAllChildMenuByMenuId(id, UacMenuStatusEnum.ENABLE.getType());
// 禁用菜单以及子菜单
result = this.disableMenuList(menuList, loginAuthDto);
} else {
// 获取菜单、其子菜单以及父菜单
UacMenu uacMenu = new UacMenu();
uacMenu.setPid(id);
result = this.selectCount(uacMenu);
// 此菜单含有子菜单
if (result > 0) {
menuList = this.getAllChildMenuByMenuId(id, UacMenuStatusEnum.DISABLE.getType());View on GitHub (pinned to 781281a950)