Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dee 118 posts 338 karma points
    Aug 26, 2020 @ 19:17
    Dee
    0

    Get All Members including their assigned Member Groups (Roles)

    Hey Guys,

    I am wondering if there is a way how to get all members including their assigned member groups (roles)?

    The method GetAllMembers in the MemberService retrieves all members, but when I iterate the members, the property "Groups" is null:

    enter image description here

    I need to sort the members, based on their assigned groups, and this is only doable, if i know the assigned groups of the retrieved members.

  • Jeremias 53 posts 278 karma points
    Dec 22, 2020 @ 10:20
    Jeremias
    0

    Hi Dee,

    you can try it with this:

    var groups = Current.Services.MemberService.GetAllRoles(member.Id);
    

    It's a seperate call for every Member. I hope this will help you!

  • Huw Reddick 1736 posts 6076 karma points MVP c-trib
    Dec 24, 2020 @ 09:20
    Huw Reddick
    0

    you can also use the standard .net roles etc

        var roles = Roles.GetAllRoles();
        foreach (var role in roles)
        {
            var usersinrole = Roles.GetUsersInRole(role);
        }
    
Please Sign in or register to post replies

Write your reply to:

Draft