Thanks for your post. Even dev and test have different permissions. I've tried creating a local group on the SQL server, and adding that to the DB role, thinking that would give a level of abstraction, but SQL includes the server name with the local group name.
At the moment I'm excluding the definition of the database role from Source Control, but including the permissions granted to the role on table definitions etc. Just need to make sure the role is in each environment before code is deployed.
It gets a bit confusing as SQL compare picks up the role when I do deployments, so I have to actually read the screen and check the right objects before deploying. Wouldn't it be nice just to be able to do a quick check and click 'deploy'. Can objects be excluded from the compare?