iflytek/astron-agent · error · BusinessException
EXCEED_AUTHORITY
EXCEED_AUTHORITY
Error message
BusinessException(ResponseEnum.EXCEED_AUTHORITY)
What it means
selfModelConfig verifies that the current user (from UserInfoManagerHandler) owns the model row. If the stored uid differs from the caller's uid, it throws BusinessException(EXCEED_AUTHORITY): the user is attempting to read/modify another user's custom model configuration.
Solutions
- Confirm the caller owns the model id before calling the endpoint
- Check the auth token/session is valid and resolves to the expected userId
- Do not reuse model ids from other users or spaces in clients
- If admin access is needed, add an explicit admin path rather than bypassing ownership
Defensive patterns
Strategy: validation
Validate before calling
// ownership check before calling
Model m = modelMapper.selectById(id);
if (m == null || !Objects.equals(currentUserId, m.getUid())) {
throw new SecurityException("model " + id + " is not owned by the current user");
} Try / catch
try {
llmService.selfModelConfig(id, 0);
} catch (BusinessException e) {
// EXCEED_AUTHORITY: return 403-style response, do not retry
} Prevention
- Scope model queries by current user/space so foreign ids 404
- Ensure auth middleware reliably resolves userId
- Never accept arbitrary model ids without ownership checks
- Log ownership violations for security review
When it happens
Trigger: Authenticated user A requests self-model config for a model id owned by user B. Also occurs when the auth context is missing/misresolved so uid resolves to a different (or empty) identity than the model owner.
Common situations: Sharing model ids across accounts/spaces; broken auth header so userId resolves incorrectly; admin tooling acting without impersonation; id guessed/enumerated by a client.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/cdbe7a477692e347.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/model/LLMService.java:553
.fluentPut("patchId", patchId));
}
});
return array;
}
public Object selfModelConfig(Long id, Integer llmSource) {
if (llmSource != 0) {
throw new BusinessException(ResponseEnum.NOT_CUSTOM_MODEL);
}
String uid = UserInfoManagerHandler.getUserId();
Model one = modelMapper.selectOne(new LambdaQueryWrapper<Model>().eq(Model::getId, id));
if (one == null) {
throw new BusinessException(ResponseEnum.MODEL_NOT_EXIST);
}
if (!Objects.equals(uid, one.getUid())) {
throw new BusinessException(ResponseEnum.EXCEED_AUTHORITY);
}
List<Config> configs = JSON.parseArray(one.getConfig(), Config.class);
if (CollUtil.isNotEmpty(configs)) {
for (Config config : configs) {
Float precision = config.getPrecision();
if (precision != null) {
// If precision is an integer greater than 1, convert to decimal form, e.g., 1 to 0.1, 2 to 0.01,
// etc.
int intPrec = Math.round(precision);
if (precision >= 1 && Math.abs(precision - intPrec) < 1e-6) {
float newPrec = 1f / (float) Math.pow(10, intPrec);
config.setPrecision(newPrec);
}
}
}
}
return ApiResult.success(configs);
}View on GitHub (pinned to 5e758547a8)