Question about IMayHaveTenant behaviour
See original GitHub issueHello @hikalkan,
To start with, I’d like to say that it’s great that ABP is developing so fast and you release new features all the time. ABP framework community is growing and It’s great!
I’d like to clarify a few things about IMayHaveTenant-inherited entities behaviour.
- As far as I understood, It’s mostly used to offer (common) shared information to all tenants?
- Is it correct that if I have such set of entities, I’ll be able (when logged in as a tenant) to get entities which have
TenantId IS NULL OR TenantId = X
(where X – actual TenantId)? If answer to the second question is positive, then there is probably an issue because I’m not able to reproduce the test case I’ve described in the question.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (9 by maintainers)
Top Results From Across the Web
How to disable MayhaveTenant filter for super admin(Host)?
1 Answer. You can create a base class for the AppService, then derive your application services from this class. In the constructor of...
Read more >Security weakness to IMustHaveTenant / IMayHaveTenant ...
I have found that while IMustHaveTenant ensures that newly inserted entities are stored against the active tenant, the same behavior is not ...
Read more >Multi-Tenancy
IMayHaveTenant is not as common as IMustHaveTenant. For example, a Product class can not be IMayHaveTenant since a Product is related to the...
Read more >Question-Behavior Effect Meta-Analysis 1
The question-behavior effect has been demonstrated for a variety of behaviors including: registering to vote and voting in elections (Gerber & Green, 2005a;b; ......
Read more >Support Center | ABP Commercial
ABP Commercial official channel for technical support. Ask questions, report issues, search for already solved issues.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IMayHaveTenant is for sharing entities between host and tenants. When TenantId is null, it means entity belongs to host. Tenants can not get it.
Your second assumption is not correct. When you login as Tenant X, By default you can get only records with TenantId = X.
You can also switch to host in your code and get TenantId = null records, but this is not the default behaviour. http://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#switching-between-host-and-tenants
My solution for shared entities: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4460#issuecomment-866566252