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

Forums / Developing with Sitefinity / Automatically assigning role

Automatically assigning role

2 posts, 0 answered
  1. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    13 Oct 2010
    Link to this post
    I have a custom profile field added through the default provider. The client would like to assign a user role depending on that field at the time or registration.  Is that possible?

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Oct 2010
    Link to this post
    Hi Steven,

    Create the membeship user and assign the property to it. Then read the property by using GetPropertyValue method of ProfileBase object and add the user to role by using AddUserToRole method of the UserManager class.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered