{"record":{"id":"d1c40bf1d2dba493","repo":"apache/dolphinscheduler","slug":"30001","errorCode":"30001","errorMessage":"user has no operation privilege","messagePattern":"user has no operation privilege","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java","lineNumber":185,"sourceCode":"        boolean hasAssociatedAlertGroup = checkHasAssociatedAlertGroup(String.valueOf(alertPluginInstanceId));\n        if (hasAssociatedAlertGroup) {\n            throw new ServiceException(Status.DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED);\n        }\n\n        alertPluginInstanceMapper.deleteById(alertPluginInstanceId);\n    }\n\n    /**\n     * get alert plugin instance\n     *\n     * @param loginUser login user\n     * @param id get id\n     * @return alert plugin\n     */\n    @Override\n    public AlertPluginInstance getById(User loginUser, int id) {\n        if (!canOperatorPermissions(loginUser, null, AuthorizationType.ALERT_PLUGIN_INSTANCE, ALARM_INSTANCE_MANAGE)) {\n            throw new ServiceException(Status.USER_NO_OPERATION_PERM);\n        }\n        return alertPluginInstanceMapper.selectById(id);\n    }\n\n    @Override\n    public List<AlertPluginInstanceVO> queryAll(User loginUser) {\n        checkAlertPluginInstanceViewPermission(loginUser);\n        List<AlertPluginInstance> alertPluginInstances = alertPluginInstanceMapper.queryAllAlertPluginInstanceList();\n        return buildPluginInstanceVOList(alertPluginInstances);\n    }\n\n    @Override\n    public boolean checkExistPluginInstanceName(User loginUser, String pluginInstanceName) {\n        checkAlertPluginInstanceViewPermission(loginUser);\n        return alertPluginInstanceMapper.existInstanceName(pluginInstanceName) == Boolean.TRUE;\n    }\n\n    @Override","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java#L167-L203","documentation":"Raised in AlertPluginInstanceServiceImpl.getById when canOperatorPermissions denies the user access to the alert plugin instance. Only admins or users granted the relevant alert-plugin permission may view the instance; the guard protects plugin configuration details.","triggerScenarios":"Calling the query alert-plugin-instance-by-id API with a user who has no alert-plugin-instance manage permission.","commonSituations":"Non-admin users inspecting alert instance details; automated dashboards using restricted service accounts.","solutions":["Grant the user alert-plugin-instance manage permission in the Security Center.","Fetch the instance as an admin user.","Check the user's permission grants for AuthorizationType.ALERT_PLUGIN_INSTANCE."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!permissionCheck.userHasAuthorization(loginUser, AuthorizationType.ALERT_PLUGIN_INSTANCE)) {\n    throw new SecurityException(\"user lacks ALARM_INSTANCE_MANAGE permission\");\n}","typeGuard":null,"tryCatchPattern":"try { AlertPluginInstance inst = alertPluginInstanceService.getById(loginUser, id); } catch (ServiceException e) { if (e.getCode() == Status.USER_NO_OPERATION_PERM.getCode()) { /* redirect to permission request flow */ } throw e; }","preventionTips":["Grant read/manage permissions for users who need to view alert instances","Handle error code 30001 centrally in clients","Document required permissions in API docs"],"tags":["authorization","permissions"],"backgroundTag":"permission-denied","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}