question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question about IMayHaveTenant behaviour

See original GitHub issue

Hello @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.

  1. As far as I understood, It’s mostly used to offer (common) shared information to all tenants?
  2. 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, May 23, 2016

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

0reactions
saliksalycommented, Jun 23, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found