Add ambient auditing disable/enable support.#24718
Merged
ahmetcelik05 merged 3 commits intodevfrom Jan 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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()andIsAuditingEnabled()methods toIAuditingHelperinterface to manage auditing state - Implemented ambient scope management using
IAmbientScopeProvider<AuditingDisabledState>inAuditingHelper - Added comprehensive test coverage for the new auditing disable/enable functionality including nested scope scenarios
- Applied the feature in
CmsKitPageRouteValueTransformerto 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 |
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs
Outdated
Show resolved
Hide resolved
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs
Outdated
Show resolved
Hide resolved
…per.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
EngincanV
approved these changes
Jan 23, 2026
Member
|
CmsKitPageRouteValueTransformer.cs now injects a new service. |
ahmetcelik05
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.