1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Default Role for New User Signin

Default Role for New User Signin

4 posts, 0 answered
  1. Kalpana
    Kalpana avatar
    27 posts
    Registered:
    18 Dec 2008
    26 Feb 2009
    Link to this post
    Hi

    I am using the Create new User control to create a new user. Is there a setting in Sitefinity to assign a default role like NewMember to users that get created?

    Thanks

    Kalpana
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Feb 2009
    Link to this post
    Hello Kalpana,

    Thank you for using our services.

    Open the controlnin edit mode and specify in wich role your user will belong by altering DefaultRoles property.
    You can also modify the control backend or create a custom one and manage roles porgrammatically

    string role1 = "administrators";  
    UserManager user = new UserManager(CreateUser.MembershipProvider);  
    user.AddUserToRole(CreateUser.UserName, role1); 

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Kalpana
    Kalpana avatar
    27 posts
    Registered:
    18 Dec 2008
    04 Mar 2009
    Link to this post
    Thanks Ivan. That helped.

    Kalpana
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Mar 2009
    Link to this post
    Hi Kalpana,

    You can also gather more information about how to use User Manager class form out dev manual.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered