{"record":{"id":"2c3062083aa58064","repo":"paascloud/paascloud-master","slug":"uac10011001","errorCode":"UAC10011001","errorMessage":"UAC10011001","messagePattern":"UAC10011001","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java","lineNumber":145,"sourceCode":"\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<MenuVo> getOwnAuthList(Long userId) {\n\t\treturn uacActionMapper.getOwnAuthList(userId);\n\t}\n\n\t@Override\n\t@Transactional(readOnly = true, rollbackFor = Exception.class)\n\tpublic List<Long> getCheckedMenuList(Long roleId) {\n\t\tif (roleId == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10012001);\n\t\t}\n\t\treturn uacActionMapper.getCheckedMenuList(roleId);\n\t}\n\n\t@Override\n\tpublic List<UacAction> getOwnActionListByUserId(Long userId) {\n\t\tif (userId == null) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011001);\n\t\t}\n\t\tList<UacAction> uacActionList;\n\t\tif (Objects.equals(userId, GlobalConstant.Sys.SUPER_MANAGER_USER_ID)) {\n\t\t\t// 获取全部权限信息\n\t\t\tuacActionList = uacActionMapper.selectAll();\n\t\t} else {\n\t\t\tuacActionList = uacActionMapper.getOwnUacActionListByUserId(userId);\n\t\t}\n\t\treturn uacActionList;\n\t}\n\n\t@Override\n\tpublic List<UacAction> listActionListByRoleId(Long roleId) {\n\t\treturn uacActionMapper.listActionListByRoleId(roleId);\n\t}\n\n\t@Override\n\tpublic List<UacAction> listActionList(List<UacMenu> uacMenus) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacActionServiceImpl.java#L127-L163","documentation":"UAC10011001 is thrown by getOwnActionListByUserId when userId is null (UAC10011xxx = user/permission group). It guards the per-user action listing which would otherwise behave ambiguously for a null user.","triggerScenarios":"getOwnActionListByUserId(null), typically when session/user context was lost, anonymous access, or the userId was not copied from the auth header/token.","commonSituations":"Expired session leaving userId null; internal service call forgetting to forward the user id; misconfigured auth filter not populating the header.","solutions":["Ensure the authenticated userId is resolved and passed in (from LoginAuthDto/session)","Fix auth/session handling so userId is never null for this path","Validate userId != null before the call"],"exampleFix":"// before\nList<UacAction> actions = uacActionService.getOwnActionListByUserId(loginAuthDto.getId());\n// after\nPreconditions.checkNotNull(loginAuthDto, \"login user required\");\nPreconditions.checkNotNull(loginAuthDto.getId(), \"userId required\");\nList<UacAction> actions = uacActionService.getOwnActionListByUserId(loginAuthDto.getId());","handlingStrategy":"validation","validationCode":"if (userId == null) { throw new IllegalStateException(\"user not authenticated\"); }","typeGuard":"null","tryCatchPattern":"try { return service.getOwnActionListByUserId(userId); } catch (UacBizException e) { return Collections.emptyList(); }","preventionTips":["Resolve userId from the auth context before service calls","Ensure auth filters propagate the user id header","Redirect to login when session identity is missing"],"tags":["null-argument","user","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}