Assign user role

How to assign role from the user using server scripting dynamically
@buildwithhussain @rmehta @saurabh6790