Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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!
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) )
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");
Perfect - I would have expected a method under from the MemberHelper but I supose this is because it's IPublishedContent?! Either way that works.
you can also use the .net security for this
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted