Skip setting the role if owner

This commit is contained in:
Alexander Hellbom 2016-10-18 23:43:03 +02:00
parent b85715ea51
commit 9ab1093633
1 changed files with 6 additions and 1 deletions

View File

@ -93,7 +93,12 @@ func buildUserStruct(d *schema.ResourceData) *pagerduty.User {
} }
if attr, ok := d.GetOk("role"); ok { if attr, ok := d.GetOk("role"); ok {
user.Role = attr.(string) role := attr.(string)
// Skip setting the role if the user is the owner of the account.
// Can't change this through the API.
if role != "owner" {
user.Role = role
}
} }
if attr, ok := d.GetOk("job_title"); ok { if attr, ok := d.GetOk("job_title"); ok {