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 need to find out the assigned member group to current logged in member in the home page.
@inject IMemberManager _memberManager; var currentUser = await _memberManager.GetCurrentMemberAsync();
this is how I get the current user, but the currentUser has no Member Group attribute. I have two member groups Admin and Basic.
currentUser
Member Group
Admin
Basic
worth to mention
@inject IMemberGroupService _memberGroupService; var groups = _memberGroupService.GetAll();
just list the group names.
any idea? cheers
Hi Shahab
I wonder if you could inject IUmbracoUserManager, you can use it for Members or backoffice users
https://apidocs.umbraco.com/v9/csharp/api/Umbraco.Cms.Core.Security.IUmbracoUserManager-1.html#UmbracoCmsCoreSecurityIUmbracoUserManager1GetRolesAsync_0
and call GetRolesAsync
is that what you need?
regards
marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Umbraco Member Group and Member Manager Services
I need to find out the assigned member group to current logged in member in the home page.
this is how I get the current user, but the
currentUser
has noMember Group
attribute. I have two member groupsAdmin
andBasic
.worth to mention
just list the group names.
any idea? cheers
Hi Shahab
I wonder if you could inject IUmbracoUserManager, you can use it for Members or backoffice users
https://apidocs.umbraco.com/v9/csharp/api/Umbraco.Cms.Core.Security.IUmbracoUserManager-1.html#UmbracoCmsCoreSecurityIUmbracoUserManager1GetRolesAsync_0
and call GetRolesAsync
is that what you need?
regards
marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.