JonPSmith / AuthPermissions.AspNetCore

This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
https://www.thereformedprogrammer.net/finally-a-library-that-improves-role-authorization-in-asp-net-core/
MIT License
788 stars 159 forks source link

Each Created Tenant should have Admin Role #100

Open TanmayKhalikar opened 9 months ago

TanmayKhalikar commented 9 months ago

Like in Example - 3 We can assign Tenant Admin Role or Tenant User Role to created Tenant. Same thing I want to Perform in Example No - 4 Hierarchical Tenant Creation so each created tenant by parent tenant should also get an Admin Role or User Role as per Tenant's Demand

JonPSmith commented 9 months ago

Hi @TanmayKhalikar,

I am not sure how you add an Tenant Admin Role or Tenant User Role to created Tenant like Example3. The typical way is to use the IAuthRolesAdminService service to add your two Roles (see this section in the AuthP's documentation).

You can use the IAuthRolesAdminService service with a Hierarchical multi-tenant application, but it has some differences:

Example4 has this Tenant user feature in it - try logging into Example4's app and log in as "westCoastManager@4uInc.com" and then use "Auth Admin -> List all AuthUsers" and you will various users that the "westCoastManager@4uInc.com" can control.