qiuyanjun888 opened a new pull request, #18368:
URL: https://github.com/apache/dolphinscheduler/pull/18368

   ## Was this PR generated or assisted by AI?
   
   YES. The patch and tests were assisted by AI and reviewed locally.
   
   ## Purpose of the pull request
   
   Fix #17933. Restrict global audit log queries so non-admin users can only 
view their own audit logs, while administrators keep the full audit view.
   
   ## Brief change log
   
   - Pass login user context from `AuditLogController` to `AuditService`.
   - Add an optional `userId` filter to `AuditLogMapper.queryAuditLog`.
   - Apply `userId` filtering for non-admin users and keep admin queries global.
   - Add/adjust unit tests for service behavior and mapper userId filtering.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - `./mvnw verify -B -pl "dolphinscheduler-dao,dolphinscheduler-api" 
-Dmaven.test.skip=false -Dspotless.skip=true -DskipUT=false -Danalyze.skip=true 
-Djacoco.skip=true -Dsurefire.printSummary=true -Dsurefire.useFile=false 
-Dsurefire.reportFormat=plain -Dsurefire.redirectTestOutputToFile=false 
-Dsurefire.failIfNoSpecifiedTests=false -Dtest='AuditServiceTest'`
   - `./mvnw verify -B -pl "dolphinscheduler-dao" -Dmaven.test.skip=false 
-Dspotless.skip=true -DskipUT=false -Danalyze.skip=true -Djacoco.skip=true 
-Dsurefire.printSummary=true -Dsurefire.useFile=false 
-Dsurefire.reportFormat=plain -Dsurefire.redirectTestOutputToFile=false 
-Dsurefire.failIfNoSpecifiedTests=false -Dtest='AuditLogMapperTest'`
   - `./mvnw spotless:check -B -pl "dolphinscheduler-dao,dolphinscheduler-api"`
   
   ## Pull Request Notice
   
   [Pull Request 
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to