Draft
Add tenant query filtering in TenantInterceptor via OnQuery#95
TenantInterceptor via OnQuery#95Conversation
Open
Co-authored-by: nygula <13066114+nygula@users.noreply.github.com>
Contributor
|
须加测如下场景 : 1.有租户 + 已有whereexpression的情况 是否自动过滤 2. 有租户.纯FindAll() Find()等无whereexpression的情况 是否空查询也过滤 3. tennatid=0的情况 是否可见全部 4. 未设置租户上下文的情况 是否会报错 @copilot |
Copilot
AI
changed the title
[WIP] Add query filter to TenantInterceptor
Add tenant query filtering in Aug 14, 2026
TenantInterceptor via OnQuery
Co-authored-by: nygula <13066114+nygula@users.noreply.github.com>
Contributor
Author
已补充你提到的四类场景测试并提交到
|
nnhy
approved these changes
Aug 14, 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.
TenantInterceptoronly handled create/validate flows, so tenant-scoped entities were not consistently filtered during query construction. This change adds query-time tenant condition injection at the interceptor layer so tenant filtering is applied automatically for registered entities implementingITenantScope.Interceptor query-path fix
OnQuery(IEntityFactory, Expression?, QueryAction)toTenantInterceptor.where(includingnull) and appends tenant constraints through existingApplyTenant(factory)logic.ApplyTenantcalls in business code.Focused coverage for tenant query behavior
TenantContextTestsfor: