Copied to clipboard

Flag this post as spam?

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


  • Dan Jacobs 7 posts 80 karma points
    Jan 31, 2016 @ 01:10
    Dan Jacobs
    0

    Members - default Group on registration

    Hello,

    I am using the snippet 'Register Member' partial view macro which allows me to have visitors register. What I really need is for those who register to be put into a Group automatically so now they can access a restricted page/section of the site.

    This seems a fundamental part of role based protection - for a visitor to register and then get access to a certain area of the site.

    For the life of me I can't see how to do it. I can see I can set a custom member type alias, but that doesn't help my situation?

    Any help would be much appreciated!

    Thanks

    Dan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 31, 2016 @ 09:30
    Jan Skovgaard
    0

    Hi Dan

    It's been a while since I've had a look at this myself but I think you should be able to extend the current code using the AddRole() method from the member service API here https://our.umbraco.org/documentation/reference/management/services/memberservice

    Hope this helps.

    /Jan

  • Dan Jacobs 7 posts 80 karma points
    Feb 04, 2016 @ 10:31
    Dan Jacobs
    0

    Thanks for your reply!

    When you say extend the current code... my Umbraco website is hosted by pipeten.co.uk - so I only have access to files via FTP and the back-end CMS. Is there a way for me to achieve this or am I stuck?

    Cheers!

    Dan

  • Bijesh Tank 192 posts 420 karma points
    Feb 04, 2016 @ 11:14
    Bijesh Tank
    0

    Hi Dan,

    Are you looking for something like this?

    MemberService.AssignRole(member.Id, "GroupName");
    

    After you have created a member, you can then assign them a role as above.

    Make sure you have created a member group in the Members section so you can assign the role to your members.

    /B.

  • Dan Jacobs 7 posts 80 karma points
    Feb 05, 2016 @ 11:25
    Dan Jacobs
    0

    Hi Bijesh - thanks for the reply.

    So looking at the "Register Member" snippet in Partial View Macros, would I put this code in there? If so.. where?

    Else where would this code go?

    Cheers!

    Dan

  • Glen Kelley 3 posts 73 karma points
    Apr 06, 2016 @ 10:07
    Glen Kelley
    0

    Hi Dan

    There was another thread requesting this sort of functionality to which I've posted a reply, hope it helps.

    https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/64185-Assign-new-members-to-member-group-upon-registration#comment-244173

    Regards

Please Sign in or register to post replies

Write your reply to:

Draft