Currently in the ABP Framwwork , while fetching any data , in case of a multitenant application, the currently logged-in user and the tenantId are checked by default. But for our application we want to be able to extend the ABPSession to also include another field called AccountId. So our session should check Logged-inUserId + TenantId + AccountId. Is it possible to override the existing methods (like GetAll() etc.)so that we can check the above OR it will manage automatically ?
2 Answer(s)
-
0
UserId is checked in AuthorizationHelper. You can implement IAuthorizationHelper:
internal class AccountAuthorizationHelper : IAuthorizationHelper, ITransientDependency { }
Replace the default AuthorizationHelper in your module:
public override void PreInitialize() { Configuration.ReplaceService<IAuthorizationHelper, AccountAuthorizationHelper>(); }
-
0
Hi @omkarchoudhari,
If you are using ASP.NET Core, you can define your custom session like this: <a class="postlink" href="https://gist.github.com/ismcagdas/6f2a9a3b5d7b907cb8d94a72124d59a1">https://gist.github.com/ismcagdas/6f2a9 ... 72124d59a1</a>
Then you can use it to filter your entities in this example: #2428@570793a7-71cc-490f-8e5f-db9f0e2ef644
Thanks.