Open Closed

Tenant Creation #2987


User avatar
0
darutter created

I'm using version 5.2 commercial creating a Blazor server app.

I have a situation in my app where a tenant needs to create a new tenant. I tried to use the TenantAppService to create it but it fails because of lack of permissions. I can't add the permission to the tenant that needs to create the other tenant because it doesn't show up as an option in the permissions list.

Can you tell me how I can accomplish this?

The reason I need this ability is I'm creating an app where a company (distributor) has a line of products that they sell to specific dealers and that relationship needs to be created by the distributor. The reason the dealer has to be created as a tenant is that the dealer will need to log into the app as a tenant with their own set of users and products, but have access to the products of the distributor.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can change the permission scope in your PermissionDefinitionProvider

    For example:

    var group = context.GetGroup(SaasHostPermissions.GroupName);
    group.MultiTenancySide = MultiTenancySides.Both;
    var createPermission = group.GetPermissionOrNull(SaasHostPermissions.Tenants.Create);
    createPermission.MultiTenancySide = MultiTenancySides.Both;
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.