How to assign a user a role 'X" by default?

Last post 05-06-2007 2:47 PM by hypercode. 1 replies.

Sort Posts:

  • How to assign a user a role 'X" by default?

    05-06-2007, 2:31 PM
    • Contributor
      3,235 point Contributor
    • sun21170
    • Member since 03-15-2003, 8:56 AM
    • Dallas,USA
    • Posts 928

    I would like to assign a user who has registered the role 'X" automatically.

    Can I do something in configuration or in database to make this happen?

    sun21170
  • Re: How to assign a user a role 'X" by default?

    05-06-2007, 2:47 PM
    Answer
    • Participant
      825 point Participant
    • hypercode
    • Member since 07-15-2006, 10:42 AM
    • Posts 266

     This is when using the CreateUser Wizard, try this and good luck.

    In the Creating_User Event:

    Dim

     newUser As String
    newUser = UserWizard.UserName.ToString
    Dim theRole As String
    theRole = "DefaultRoleName"
    Roles.AddUserToRole(newUser, theRole)

     

Page 1 of 1 (2 items)