Copied to clipboard

Flag this post as spam?

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


  • Owen Martin 1 post 21 karma points
    Jun 21, 2011 @ 08:29
    Owen Martin
    0

    Members, MemberTypes and Roles

    Hi all.
    I am having some trouble getting my head around the concept of Members, and where they sit in the world of Umbraco.
    I understand they are 'front of house' logins, and therefore different to Users.
    My major annoyance is the following:
    I would like a member to be created, and assigned to one of two member types, depending on the options they choose during sign up. Looking through the old documentation, I could create a new member by Member.MakeNew(), however this has been deprecated in favour of the standard aspnet memberhip model. So I create my new user by doing Membership.CreateNew(), and I get a MembershipUser back.
    How can I then assign that new MembershipUser to a member type? Am I able to cast/convert it to an umbraco Member object? But even then there seems to be no API to link a Member and MemberType!
    Finally, where do MemberGroups come into all this, and why are they different to Types?

    Thanks!!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 21, 2011 @ 08:52
    Dirk De Grave
    0

    Owen,

    The member type assigned to the member when using Membership.CreateNew() is set as an attribute in the web.config on the membership provider (defaultMemberTypeAlias="x"). If attribute is not set, it will default to "Default" member type in the backend.

    If you need to create members with different member types, you'll have to add another provider (and just need to change the defaultMemberTypeAlias to another member type defined in the backend).

    Multiple providers can be useful if you need different authentication logic for some members (altho still have to find a use case for that...)

    You can then change the provider you'd like to use programmatically (otherwise it will use the default one specified on the membership config)

    Membergroups = roles

     

    Hope this helps.

    Regards.

    /Dirk

     

Please Sign in or register to post replies

Write your reply to:

Draft