Skip to content

Commit

Permalink
Prevent using user name with bitbucket_repository_user_permission. Mu…
Browse files Browse the repository at this point in the history
…st be UUID.
  • Loading branch information
Barry Hart committed May 18, 2024
1 parent 3bf2b3a commit c4e4049
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bitbucket/resource_repository_user_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func resourceRepositoryUserPermissionPut(ctx context.Context, d *schema.Resource
d.SetId(fmt.Sprintf("%s:%s:%s", workspace, repoSlug, userSlug))
}

if userSlug != permission.User.UUID {
return diag.FromErr(fmt.Errorf("The user_id must be a UUID, but a user name was given (\"%s\"). The UUID for this user is \"%s\".", userSlug, permission.User.UUID))
}

return resourceRepositoryUserPermissionRead(ctx, d, m)
}

Expand Down

0 comments on commit c4e4049

Please sign in to comment.