Copied to clipboard

Flag this post as spam?

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


  • Saief 7 posts 99 karma points
    Nov 19, 2016 @ 14:26
    Saief
    0

    Creating a member in a "Member group" issue

    Hi everyone

    I finally managed to make a system for visitors to be able to create a membership, login, sign out etc. All this was done based on SurfaceControllers.

    Now the only mystery here is, once the member is created, in umbracos back office the member is created though he is set to be: NOT A MEMBER OF GROUP(S)

    in my code I do believe that that member should be added to the group:

      var member = memberService.CreateMemberWithIdentity(model.Email, model.Email, model.Name, "Member");
    

    How do I make members to be able to be active a in a member group?

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Nov 19, 2016 @ 14:37
    Michaël Vanbrabandt
    100

    Hi Saief,

    Maybe this will do the trick

    // Assign the correct role
    Services.MemberService.AssignRole(member.Id, "MemberRole");
    

    /Michaël

  • Saief 7 posts 99 karma points
    Nov 19, 2016 @ 14:57
    Saief
    1

    Cheers buddy, you saved me twice this weekend already! :)

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Nov 19, 2016 @ 17:19
    Michaël Vanbrabandt
    0

    Saief,

    No problem!

    Thats why we here for!

    Have a nice day

    /Michael

  • 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.

Please Sign in or register to post replies