Skip to content

Commit

Permalink
Merge pull request #209 from barrywhart/fix-issue-repository-user-per…
Browse files Browse the repository at this point in the history
…mission-should-be-uuid

Prevent using user name with bitbucket_repository_user_permission. Must be UUID.
  • Loading branch information
DrFaust92 authored May 30, 2024
2 parents 3bf2b3a + c4e4049 commit bb787af
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 bb787af

Please sign in to comment.