Using javascript to set User/Member roles

I’m fairly new to Wix and still getting to grips with it so perhaps this is obvious. My issue is pretty straightforward, my site has two types of member, buyers and sellers. I have one registration form with a toggle that allows users to sign up as either a buyer or a seller. I have set up new Roles in the Member Permissions area “Buyer” and “Seller”. When the user has completed the signup form they click submit, I do some checks using javascript and use the WixUser.Register() to create a new member but I cannot find any way to set the Role using code. I don’t want to have to set each member’s role manually after they have signed up, I know what they are when they sign up so surely there is an easy way to assign the appropriate role? What I would like is something like wixUser.SetRole(role)… Any clarification or help much appreciated.

1 Like