Rather than put the entity at the tenant level, we want to edit a tenants departments at the host level.
If I use the radtool - the Tenant isn't available as a navigation property.
We would like to search across tenants and all departments for a specific department sometimes, whie logged in as host.
In addition, we don't want the tenant being able to add or remove departments.
Would it be better to add this to the tenant and host, then define a role for the tenant so they have no access to departments?
Not sure of the best approach. Any advice is appreciated.
5 Answer(s)
-
0
Hi @marble68
If I understand this correctly, you should define your entity on Host side as a non multi tenant entity. You can manually add a relation to Tenant wihtout using the Power Tools.
-
0
ok - Ill experiment with that.
thank you
-
0
Do you have an example of manually adding the relation to a Tenant I could look at?
Do I just put the nullable TenantId on the model, then modify the getall to include the current TenantId to ensure each tenant is only returned associated entities?
Thanks
-
0
Hi @marble68
Since it is not inherits IMayHaveTenant or IMustHaveTenant you should filter it by tenant yourself. Like:
var list= _myEntity.GetAll().Where(x=>x.TenantId == input.TenantId).Tolist()
Since I don't know your structure, I shared a sample code. If you have difficulty in writing the query, if you share the entity and other related code parts and the query you want to write, I can help you in more detail.
-
0
This is what I'm doing now - Ok, great - but I need to add that TenantId to the DTOs and Entity as well I guess; unless I specify it in the rad tool.
ok, Thanks.