Skip to content

Add ambient auditing disable/enable support.#24718

Merged
ahmetcelik05 merged 3 commits intodevfrom
AuditingDisabledState
Jan 23, 2026
Merged

Add ambient auditing disable/enable support.#24718
ahmetcelik05 merged 3 commits intodevfrom
AuditingDisabledState

Conversation

@maliming
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds ambient auditing disable/enable support to the ABP Framework, allowing developers to temporarily disable auditing for specific code blocks using a disposable scope pattern. This is useful for scenarios like route matching operations that shouldn't be audited.

Changes:

  • Added DisableAuditing() and IsAuditingEnabled() methods to IAuditingHelper interface to manage auditing state
  • Implemented ambient scope management using IAmbientScopeProvider<AuditingDisabledState> in AuditingHelper
  • Added comprehensive test coverage for the new auditing disable/enable functionality including nested scope scenarios
  • Applied the feature in CmsKitPageRouteValueTransformer to disable auditing during page slug existence checks

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingHelper.cs Added two new methods to the public API: DisableAuditing() and IsAuditingEnabled()
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs Implemented the new methods using ambient scope provider pattern, integrated check into ShouldSaveAudit method
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingDisabledState.cs New state class to track disabled auditing state in ambient scopes
framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AuditingHelper_Tests.cs Comprehensive test coverage for disable/enable functionality, nested scopes, and scope disposal
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKitPageRouteValueTransformer.cs Applied auditing disable during route matching to avoid auditing page existence checks

maliming and others added 2 commits January 23, 2026 18:49
…per.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@EngincanV
Copy link
Member

CmsKitPageRouteValueTransformer.cs now injects a new service.

@ahmetcelik05 ahmetcelik05 merged commit 255efbf into dev Jan 23, 2026
3 of 4 checks passed
@ahmetcelik05 ahmetcelik05 deleted the AuditingDisabledState branch January 23, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants