Open Closed

Listing All user from certain host #1665


User avatar
0
devraj.np@gmail.com created
  • ABP Framework version: v4.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I need to list all the users of certain role in host, This should be a list of all users in a specific role from all tenants.


2 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi devraj.np

    var roleId = Guid.NewGuid(); //Your role id
    var role = await _identityRoleManager.GetByIdAsync(roleId);
    var usersInRole = _identityUserRepository.GetListByNormalizedRoleNameAsync(role.NormalizedName);
    
    using (_multiTenantFilter.Disable()) //IDataFilter<IMultiTenant>
    {
        var roleId = Guid.NewGuid();
        var role = await _identityRoleManager.GetByIdAsync(roleId);
        var usersInRole = _identityUserRepository.GetListByNormalizedRoleNameAsync(role.NormalizedName);
    }
    
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11