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
How can I get a list of member groups of the currently logged in member ?
Have you tried the Membership Helper?
Is this via a controller? In C#?
If you do have any further questions please ask.
I've looked at the MemberShipHelper, but can't really see anything regarding Groups or Roles.
It's actually in the Partial View Macro Login.cshtml that comes with the Umbraco solution.
The helper do have methods for that, but unfortunately only in Umbraco 8.
In Umbraco 7, this part is instead delegated to ASP.NET, which has the System.Web.Security.Roles class. So you can call Roles.GetRolesForUser(username) and get an array back with the names of the member groups the member is a part of.
Be aware that looking up the roles for many users at once may be expensive. I think the helper in Umbraco 8 also relies on the Roles class internally, but adds some caching on top of it.
Ahhh ... cool.
Of course it's on Umbraco 7 :)
I'll only be looking up on a single user, when he logs in and the redirect based on the groups. So I don't think it'll be that expensive.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted