AuthPermissions.AspNetCore
AuthPermissions.AspNetCore copied to clipboard
Create admin user with tenant admin role
Hello,
I'm looking for guidance on creating a Tenant Admin User with the Tenant Admin Role for each new Tenant that gets created. I'm specifically referring to the Example4.MvcWebApp.IndividualAccounts project. How can I achieve this?
Hi @TechAspirant,
Let me say back to you on what you are asking. You want every Tenant should have a Tenant Admin User - is that correct? If so here are two suggestions which relay on you create a "Tenant Admin" role (see Example4 for an example).
- If you use the SignUpAndCreateTenant feature (see this article or this document), then you can make the user signing in to have the "Tenant Admin" role. This is the typical approach.
- If you want a App Admin to create a new Tenant, then after the Tenant is created you need to add a user for the Tenant and give them the "Tenant Admin" role. See this article or document.
I also recommend you read the Building ASP.NET Core and EF Core multi-tenant apps – Part2: Administration which gives a good overview of administration.