Copied to clipboard

Flag this post as spam?

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

  • Steve Morgan 1304 posts 4355 karma points c-trib
    Mar 06, 2015 @ 12:41
    Steve Morgan

    Members.GetCurrentMember() - check if Member belongs to a Member Group


    I'm sure I'm missing something obvious but is there a missing property of UmbracoMemberGroups? How do you tell if the current logged in user belongs to a certain group? 

    I'm trying to customise a logged in view depending on wether a user is "basic" or "full". The only way I can see to do it is to double up and create my own property and store the groups again? Surely I'm missing something obvious!


  • Kevin Jump 2174 posts 13823 karma points MVP 6x c-trib
    Mar 06, 2015 @ 13:23
    Kevin Jump


    Try Members.IsMemberAuthorized - you can pass in a list of groups to check if the user is in them or not.

    List<string> groupList = new List<string>();
    if ( Members.IsMemberAuthorized(allowGroups: groupList) ) 
  • Halden Collier 4 posts 84 karma points
    Feb 02, 2021 @ 10:28
    Halden Collier

    Is there no way to do this for a specific member? All the documentation I have found only outlines doing this for the 'CurrentUser'.

    It would be nice to have a function like this:

    objMemberService.IsMemberInGroup(member: objMember, groupName: "Group Name");
  • Steve Morgan 1304 posts 4355 karma points c-trib
    Mar 06, 2015 @ 16:01
    Steve Morgan

    Perfect - I would have expected a method under from the MemberHelper but I supose this is because it's IPublishedContent?! Either way that works. 

  • Huw Reddick 832 posts 2820 karma points
    Feb 02, 2021 @ 10:42
    Huw Reddick

    you can also use the .net security for this


Please Sign in or register to post replies

Write your reply to: