Ends in:
2 DAYS
2 HRS
27 MIN
33 SEC
Ends in:
2 D
2 H
27 M
33 S
Open Closed

Use the tenant module, permission module & CurrentUser functions without depending on database #760


User avatar
0
dev03 created
  • ABP Framework version: v4.0.2
  • UI type: Angular
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Currently we have a project which contains two sets of service packs. Amongst one is API project (one solution, let's call it Api1), another is a server project (another solution, let's call it Server1). For Server1 we plan not to have any database dependencies, only through HTTP requesting the necessary information from Api1. As a result, we delete the Database-related dependencies in Server1, but it will have follow problems:

  1. Logging in. In the Server1, If Server1.MongoDb project remove Volo.Abp.IdentityServer.MongoDB dependencies and remove the DependsOn attribute of AbpIdentityServerMongoDbModule, the property of UserName of ICurrentUser will be null. The property of UserName can be retrieved or not after deleting the Database-related dependencies?
  2. Tenant problem. Server1 needs tenant function to isolate some data. But after deleting Volo.Saas.MongoDB dependencies, it will report Tenant not found! exception when logging in.
  3. Permission. How to use ABP permission component without depending on database but with Api1 project.

In total, we want to use the tenant module, permission module & CurrentUser functions without depending on any database operations, is this possible? If so, how?

Following are the dependencies of Server1's projects:


1 Answer(s)
  • User Avatar
    0
    Moyaoxiang created

    Hi coeusli, I do not recommend this, because related components need to query existing user and permission data from the database. You can rewrite the storage code of related modules to get data from API1 (similar to RPC). You can also write the corresponding interface in the API and provide it to Server1 to use, and obtain tenant or other information through Remote Application Service on Server1.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35