Copied to clipboard

Flag this post as spam?

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


  • Mark Olbert 87 posts 117 karma points
    Oct 19, 2009 @ 01:17
    Mark Olbert
    0

    Umbraco Members, Member Types and the ASP.NET Membership Provider

    I'm confused about the relationship between Umbraco Members and ASP.NET Members. I understand that Umbraco uses the ASP.NET MembershipProvider system, but I don't see how Umbraco's Member Types fit into the picture.

    Here's what I'm trying to do: I want to restrict access to various parts of my website based on MemberType. I've created two MemberTypes, Listener and Supporter. Listener is set as the default MemberType in the web.config file.

    My understanding is that if I use the ASP.NET Membership API the members I create will be Listeners, because that's the default.

    But what do I do if I want to create someone as a Supporter? Also, can I change someone from a Listener to a Supporter, or vice versa?

    I'm also storing extended member information in a separate SqlServer table I've created. The primary key for this table is nodeID, which is defined as an integer in what I think is Umbraco's member table (cmsMember). But I'm not clear on how to retrieve the nodeID through either the ASP.NET Membership API, or Umbraco's member functions.

    - Mark

  • skiltz 501 posts 701 karma points
    Oct 19, 2009 @ 02:58
    skiltz
    1

    If your members Listener and Supporter need the same properties (i.e first name, last name etc) then create one generic memberType.  You can then create two member groups (ASP.net ROLES) called Listener and Support.  You can then assign your member to one of both member groups.

    You can get  a members node id like so:

    Member m = Member.GetMemberFromLoginName(HttpContext.Current.User.Identity.Name);
    Member m = Member.GetCurrentMember();

    You can then get the members nodeID like:

    Member.Id;

    Hope that helps.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 19, 2009 @ 07:06
    Aaron Powell
    0

    skiltz is right that it'd be much better an idea to use roles to determine the permissions within a site rather than a member type.

    I have written a few blogs on the Umbraco member API's here - http://www.aaron-powell.com/blog/september-2009/the-umbraco-membership-apis.aspx and here - http://www.aaron-powell.com/blog/july-2009/umbraco-member-profiles.aspx

  • Mark Olbert 87 posts 117 karma points
    Oct 19, 2009 @ 16:29
    Mark Olbert
    0

    Thanks for the replies, and the links.

    - Mark

Please Sign in or register to post replies

Write your reply to:

Draft