Open Closed

Multi Tenant #9647


User avatar
0
yazilim.ithinka created
  • Template: microservice
  • Created ABP Studio Version: 1.0.2
  • Current ABP Studio Version: 1.0.2
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Theme Menu Placement: side
  • Run Install Libs: Yes
  • Database Provider: ef
  • Database Management System: postgresql
  • Mobile Framework: react-native
  • Public Website: Yes
  • Social Login: Yes
  • Include Tests: Yes
  • Dynamic Localization: Yes
  • Kubernetes Configuration: Yes
  • Grafana Dashboard: Yes
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • AuditLogging
    • OpenIddictAdmin
  • Selected Languages: English, Türkçe
  • Default Language: English
  • Create Command: abp new CarbonAI -t microservice --ui-framework angular --mobile react-native --database-provider ef --database-management-system postgresql --theme leptonx --skip-migrator --public-website --without-cms-kit --dont-run-bundling -no-language-management -file-management

Hello, I have a customer, my customer has customers, I want to limit the customers and users that my customer will create here, is there a place where I can do this from your interface or do you have an infrastructure for this. Good work


6 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    To limit the number of customers (tenants) and users that your customer can create in an ABP multi-tenant application, you can use the built-in multi-tenancy and SaaS infrastructure. ABP provides mechanisms to control tenant resources, such as limiting the number of users or other resources per tenant, typically through the use of Editions and Features.

    You can define custom features (e.g., "MaxUserCount", "MaxCustomerCount") and assign them to Editions. Then, assign Editions to your tenants. In your business logic, you can check these feature values to enforce the limits when creating new users or customers.

    There is no direct UI in the Angular management interface for setting these limits out-of-the-box, but the infrastructure is available for you to implement this logic using features and editions.

    Example steps:

    1. Define a feature (e.g., "MaxUserCount") in your solution.
    2. Assign this feature to an Edition.
    3. Assign the Edition to your tenant (your customer).
    4. In your user/customer creation logic, check the current count against the feature value and prevent creation if the limit is reached.

    Example code for checking a feature value:

    var maxUserCount = await FeatureChecker.GetAsync<int>("MaxUserCount");
    if (currentUserCount >= maxUserCount)
    {
        throw new BusinessException("User limit reached for this tenant.");
    }
    

    For more details, see the official documentation on limiting tenant resources.

    Sources:

    • https://abp.io/docs/latest/Multi-Tenancy#limiting-tenant-resources

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This doesn't seem related to multi-tenancy. Are your customers isolated as tenants?

    Can you share more details about your case?

    Thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    Let's say you have an e-commerce website. And you have customers (tenants) in this CRM like Nike and Adidas. You want that the customer Nike will have max 100 users and Adidas will have 200 users, right? this is where the new user is being created => https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs#L77

  • User Avatar
    0
    yazilim.ithinka created

    [maliming] said: hi

    This doesn't seem related to multi-tenancy. Are your customers isolated as tenants?

    Can you share more details about your case?

    Thanks.

    Hi

    A customer can register to the system by itself or can be added by the administrator. When our customer is included in the system, we want to give a limit to the users that our customer will create so that our customer can create their own customer and our customer can manage the system. These operations should be provided by package management.

    This is the structure we want

    Thanks

  • User Avatar
    0
    yazilim.ithinka created

    [alper] said: Let's say you have an e-commerce website. And you have customers (tenants) in this CRM like Nike and Adidas. You want that the customer Nike will have max 100 users and Adidas will have 200 users, right? this is where the new user is being created => https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs#L77

    Yes, we actually want to build a structure like this, we will examine it. Thank you for your answer.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    A customer can register to the system by itself or can be added by the administrator.

    Let's say these customers as X customer

    our customer can create their own custome

    Let's say these customers as Y customer

    You can create a tenant for each X customer

    Then your X customer will be the tenant admin user. They can create new customers under a new tenant. Also, new customers(Y) can be registered under the new tenant.

    Your host admin can manage the tenants(aka X customer)

    Your tenant admin(aka X customer ) can manage all Y customers.

    Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37