From c4e4049f96ae4efeb01e6bfd742c99e6abdff0ea Mon Sep 17 00:00:00 2001 From: Barry Hart Date: Sat, 18 May 2024 16:54:28 -0400 Subject: [PATCH] Prevent using user name with bitbucket_repository_user_permission. Must be UUID. --- bitbucket/resource_repository_user_permission.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitbucket/resource_repository_user_permission.go b/bitbucket/resource_repository_user_permission.go index 5b3c6812..76b202dc 100644 --- a/bitbucket/resource_repository_user_permission.go +++ b/bitbucket/resource_repository_user_permission.go @@ -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) }