I'm working on a system where each tenant can setup an entity that represents an individual; these entities are unique across all tenants.
On the public site - I have an action where the unique ID of the individual is passed as the ID.
A unique URL is created for individuals that
Do I need to create a custom service to do this?
5 Answer(s)
-
1
hi
If your host and tenant are using a database, you can query these entities by disabling the filter or switching to the host. If they use different databases.
https://aspnetboilerplate.com/Pages/Documents/Data-Filters#disable-filters https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#switching-between-host-and-tenants
-
0
Ok - I've got this working - part way.
Now, the Taker goes to the public website, enters some info - and I need to update that Taker entity from the public website.
Does disabling filters resolve calling CreateOrEdit?
Here's what I'm doing:
using (var uow = UnitOfWorkManager.Begin()) { using (CurrentUnitOfWork.SetTenantId(null)) { using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete)) { _takersAppService.CreateOrEdit(input).Wait(); uow.Complete(); } } }
The error I'm getting is:
AbpAuthorizationException: Current user did not login to the application!
THanks for any advice.
-
0
It turns out I didn't have this working - the public website was getting the MVC cookie.
I added a host entry for the public website so it's a different domain, and it now fails.
-
0
hi marble68
AbpAuthorizationException: Current user did not login to the application!
This is because the authentication issue has nothing to do with the code you shared.
You don't need to disable the filter after you set up the tenantid of the unitofwork.
-
0
Unit of work, clearing filters, etc. did the trick. that's how I do this when necessary now.
Thank you.