فتح مغلق

ABP Framework capabilities #525


User avatar
0
sammy@projile.com خلقت

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.2.1
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

hi Team, We have following queries. we are using ABP commercial first time so bound with limited knowledge. Please guide:

       1) New tenant setup document when each tenant has a separate database.
       2) In the multi-tenant setup, the user has to select a tenant before login. We needs the document to make changes in the current ABP framework, which allows identifying tenant based on user credentials, without selecting the tenant.
       3) We are developing a SaaS-based product which will have a subdomain URL for each tenant. We needs a Multitenancy production hosting document so that every tenant has a subdomain within a single API and Identity deployment
       4) We needs theme customization documentation as we will be providing the new theme and existing theme customization for every tenant admin.
       5) Is there a provision to have global roles that can spam across tenant, even when each tenant is on a separate DB?
       6) If we create new entity at tenant level or super admin level, how we can extend it to multiple tenants or even globally to all tenants considering each tenant is on a separate DB?
       7) Can we customize ABP default module tables? if yes what is the best practice to make sure we don't break any existing functionality?

6 إجابة (إجابات)
  • User Avatar
    0
    liangshiwei خلقت
    فريق الدعم Fullstack Developer

    HI,

    1. The tenant management UI can set connection string and run the DbMigrator application to create database(you can also generate by code).
    2. You can custom the tenant resolver. see also https://support.abp.io/QA/Questions/447/LoginAPI-Trying-to-log-in-from-an-app-using-the-API---need-to-know-how-to-identify-the-tenant-that-the-user-belongs-to
    3. There not such docuemnt yet, You can simply deploy manually for each tenant(create website and bind domain etc...), or you can write some scirpts to auto this process. It depends on your server.
    4. You can use virtual file system to replace any style script and page. see: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface
    5. Yes you can, for example:
      1. First, change current tenant to HOST
      2. Then You can use ITenantRepository to get all tenants and change current tenant to each tenant.
    6. Same with 5
    7. See https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
  • User Avatar
    0
    sammy@projile.com خلقت

    Hello Liangshiwei, Thanks for response. Still i have confusion:

    1- Regarding Point 1: The tenant management UI can set connection string and run the DbMigrator application to create database(you can also generate by code). My Assumption: Steps are: 1- create new tenant via Angular app. 2- Add new connection string in angular UI to point to new tenant DB. 3- Run the DbMigrator app without changing any configuration i.e. DB connection url.

           Please confirm.
    

    2- Regarding Point 5: ABPRoles table has "isPublic" column. How i can get roles for any tenant if "isPublic" is 1. If we use roles across mulitple tenants and users will there be any functional challenges? My assumption is Roles are filtered based on "TenantId".

  • User Avatar
    0
    sammy@projile.com خلقت

    Hello Liangshiwei, Regarding Point 7, i have looked into the provided url "https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities" and followed "Entity Extensions (EF Core)".

    This approach has 3 steps:
    
    1. You provide the IdentityUser as the entity name, string as the type of the new property, SocialSecurityNumber as the property name (also, the field name in the database table).

    2. You also need to provide an action that defines the database mapping properties using the EF Core Fluent API.

    3. use the standard Add-Migration and Update-Database commands of the EF Core to create a code first migration class and update your database.

    for 1st step i have done changes in "ezpandtrialEfCoreEntityExtensionMappings.cs" class like below: ObjectExtensionManager.Instance .MapEfCoreProperty<IdentityUser, string>( "SocialSecurityNumber", (entityBuilder, propertyBuilder) => { propertyBuilder.HasMaxLength(128); } );

    I am not sure what exactactly changes i need to do in 2nd step. Please guide.

  • User Avatar
    0
    liangshiwei خلقت
    فريق الدعم Fullstack Developer

    HI,

    My Assumption: Steps are: 1- create new tenant via Angular app. 2- Add new connection string in angular UI to point to new tenant DB. 3- Run the DbMigrator app without changing any configuration i.e. DB connection url.

    Yes.

    Regarding Point 5: ABPRoles table has "isPublic" column. How i can get roles for any tenant if "isPublic" is 1. If we use roles across mulitple tenants and users will there be any functional challenges? My assumption is Roles are filtered based on "TenantId".

    The tenant's data is completely isolated, You cannot get the roles of all tenants via a single query, you must to switch each tenant to get a role.

    Regarding Point 7, i have looked into the provided url "https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities" and followed "Entity Extensions (EF Core)".

    ObjectExtensionManager.Instance
        .MapEfCoreProperty<IdentityUser, string>(
            "SocialSecurityNumber",
            (entityBuilder, propertyBuilder) =>
            {
                propertyBuilder.HasMaxLength(32);  // Here is the action of defining database mapping
            }
        );
    
  • User Avatar
    0
    sammy@projile.com خلقت

    Hello Liangshiwei, Thanks. I got some clarity but still struggling. I am summarizing all our discussion as per earlier threads as per attached link (i was not able to summarize all questions here and alignment was not working as expected).

    https://xpertladr-my.sharepoint.com/:w:/p/shobhit/EXn5nb1DEvBAq-6EaZNdSY4BbpfHUuKHJNhHHdc9y3E5rg?e=b5dWgb

    <br> <br>

  • User Avatar
    0
    liangshiwei خلقت
    فريق الدعم Fullstack Developer

    Good luck : )

Made with ❤️ on ABP v8.2.0-preview Updated on مارس 25, 2024, 15:11