What do you mean by “seems like assignRole is not working”? Are you testing in Preview or Live? Keep in mind that (as stated in the documentation ): " The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality. "
What are you expecting? What are you getting?