What is the correct syntax for creating a user and populating the role?

This has been a help.

I am looking to give a role permissions. I have tons of collections I would like a role to have access to but I cant see a way to do this.