Skip to content

[Fix-18276][API] Fix alert plugin instance permission check#18279

Merged
SbloodyS merged 1 commit into
apache:devfrom
ruanwenjun:issue-18276-alert-plugin-instance-permission
May 22, 2026
Merged

[Fix-18276][API] Fix alert plugin instance permission check#18279
SbloodyS merged 1 commit into
apache:devfrom
ruanwenjun:issue-18276-alert-plugin-instance-permission

Conversation

@ruanwenjun
Copy link
Copy Markdown
Member

Was this PR generated or assisted by AI?

YES. The implementation and tests were assisted by OpenAI Codex, then reviewed and verified locally.

Purpose of the pull request

Fixes #18276.

Fix alert plugin instance permission checks so alert plugin instance APIs consistently validate the current user's operation-level permission before returning alert plugin instance data.

Brief change log

  • Pass the login user into alert plugin instance list and duplicate-name check service APIs.
  • Add operation-level permission checks for alert plugin instance list, page query, and name verification flows.
  • Keep alert plugin instance checks operation-scoped without deriving fake per-instance resource permissions from alert plugin definitions.
  • Add service and controller tests for the permission checks.

Verify this pull request

This change added tests and can be verified as follows:

  • ./mvnw -pl dolphinscheduler-api -am -DskipITs -DskipTests=false -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true -Dtest=AlertPluginInstanceServiceTest,AlertPluginInstanceControllerTest test
  • ./mvnw -pl dolphinscheduler-api -am -DskipITs -DskipTests=false -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true -Dtest=AlertPluginInstanceResourcePermissionCheckTest test
  • ./mvnw -pl dolphinscheduler-dao -am -DskipITs -DskipTests=false -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true -Dtest=AlertPluginInstanceMapperTest test
  • git diff --check

Pull Request Notice

Pull Request Notice

Filter alert plugin instances through authorized alert plugin definitions and push instance checks down to SQL to avoid loading all instances in memory.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@ruanwenjun ruanwenjun added the bug Something isn't working label May 22, 2026
@ruanwenjun
Copy link
Copy Markdown
Member Author

Since the current alert group instances lack user information, it is not possible to implement more granular permission management.

Copy link
Copy Markdown
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SbloodyS SbloodyS merged commit a08de7b into apache:dev May 22, 2026
121 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [API] Alert plugin instance APIs miss permission checks

2 participants