Copied to clipboard

Flag this post as spam?

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


  • Farshad 6 posts 76 karma points
    Nov 24, 2022 @ 10:14
    Farshad
    0

    Find the member group of a member in umbraco 10

    How to get the member groups of current member in Umbraco 10?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Nov 24, 2022 @ 10:23
    Huw Reddick
    1

    us the MemberManager service

        var currentUser = _memberManager.GetCurrentMemberAsync().Result;
    
        var roles = _memberManager.GetRolesAsync(currentUser).Result;
    
  • girish 15 posts 88 karma points
    Dec 16, 2022 @ 21:11
    girish
    1

    To get all the member groups then you have to use the IMemberGroupService

    _memberGroupService.GetAll();
    

    To get a particular member details then, there you have to use IMemberManager

    _memberManager.GetRolesAsync(user)
    

    And to get the current user

    _memberManager.GetCurrentMemberAsync()
    

    If you have the userId or Email then

    Id:

    _memberManager.FindByIdAsync(UserId)
    

    Email:

    _memberManager.FindByEmailAsync(email)
    

    Use .Result to get the result value from Task<TResult>

Please Sign in or register to post replies

Write your reply to:

Draft