Open Closed

Identity-Pro User List Page #1972


User avatar
0
Spospisil created
  • ABP Framework version: v4.4.2
  • UI type:MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

We have the pro modules and are using Identity-Pro to maintain the list of users. The problem is that ABP out of the box requires you to be logged in as a user for a given tenant to create additional non admin users for that tenant.

Our model is we will have a system admin that will create users for each tenant, so we'll use the 'users' list page and have a tenant selector in that page's menu (next to the add user button) and then select a tenant from it and have is display all the users for the selected tenant and also pass the selected tenant to the add user model box (UI) for the given selected tenant.

I have been able to add a 'tenant dropdown' selector the the user's page menu and have created a controller to return an object from javascript with the 'filter' and 'selected tenant' values and pass to the controller, however I now need a repositiory routine to only give me a list of the tenants for the passed in tenant guid.

What is the best way to implement this without creating my own repository class that the controller uses to get the expected results?


4 Answer(s)
  • User Avatar
    0
    cotur created

    Hi @spospisil,

    however I now need a repositiory routine to only give me a list of the tenants for the passed in tenant guid.

    I could not understand that,

    Did you mean: "list of the users for the passed tenant guid?"

  • User Avatar
    0
    Spospisil created

    Hi,

    Yes I need a way to take the tenant guid value as selected by the dropdown (highlighted in red) and have the list of users for that tenant display in the list. However, I would like to use the IdentityUserAppService (Volo.Abp.Identity.Pro.Application project) or extend this class and/or it's existing UserRepository to select users from the underlying database that are for the selected tenant

    Screenshot included

  • User Avatar
    0
    Spospisil created

    This below link in the documentation ended up being the solution I went with to display a list of tenant users based on the selected tenant in the screenshots tenant dropdown.

    https://docs.abp.io/en/abp/latest/Multi-Tenancy#change-the-current-tenant

  • User Avatar
    0
    cotur created

    Great!

    But please be careful about it. If you did not carefully cover that with permission, it might occur a security problem.

    Thanks.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35