I'm trying to figure out the best way to query the currently signed in "member" and determine if they are signed in as an Umbraco User or Umbraco Member or both.
I want to be able to simply say:
var currentMember = GetCurrentMember();
if (currentMember == null) return "Not signed in";
if (currentMember.IsUser) return "Signed in as a Backoffice User";
if (currentMember.IsMember) return "Signed in as a Frontend Member";
Here's what I have so far:
Using umbraco.helper.GetCurrentUmbracoUser() will return whether or not the current member is a User. If the current member is signed in as a User and a Member, this call will return null.
MembershopHelper.GetCurrentMember() will return a valid IPublishedContent regardless of whether the member is a User or Member.
So, in order to determine whether the current member is a User or Member, I have to use both of these calls and compare the results.
I'm afraid not - The concepts of users and members in Umbraco are totally separate. The GetCurrentMember() call always refers to the front end website members.
The purpose of each type is very different so for most use cases it makes sense not to have any crossover between them.
Is Current Member an Umbraco User or a Member?
I'm trying to figure out the best way to query the currently signed in "member" and determine if they are signed in as an Umbraco User or Umbraco Member or both.
I want to be able to simply say:
Here's what I have so far:
Using
umbraco.helper.GetCurrentUmbracoUser()
will return whether or not the current member is a User. If the current member is signed in as a User and a Member, this call will return null.MembershopHelper.GetCurrentMember()
will return a valid IPublishedContent regardless of whether the member is a User or Member.So, in order to determine whether the current member is a User or Member, I have to use both of these calls and compare the results.
Isn't there a better way?
I'm afraid not - The concepts of users and members in Umbraco are totally separate. The GetCurrentMember() call always refers to the front end website members.
The purpose of each type is very different so for most use cases it makes sense not to have any crossover between them.
is working on a reply...