diff --git a/Makefile b/Makefile index 896d0556..8f00211c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ HOSTNAME=github.com NAMESPACE=port-labs NAME=port-labs BINARY=terraform-provider-${NAME} -VERSION=0.1.0 +VERSION=0.1.1 OS=$(shell go env GOOS) ARCH=$(shell go env GOARCH) OS_ARCH=${OS}_${ARCH} diff --git a/port/resource_port_blueprint.go b/port/resource_port_blueprint.go index e63dce2b..a161feb1 100644 --- a/port/resource_port_blueprint.go +++ b/port/resource_port_blueprint.go @@ -2,7 +2,6 @@ package port import ( "context" - "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -238,24 +237,10 @@ func blueprintResourceToBody(d *schema.ResourceData) (*cli.Blueprint, error) { return b, nil } -// patchBlueprintDeletePermission is a workaround for a bug where the creator of a blueprint does not have the permission to delete it. -func patchBlueprintDeletePermission(ctx context.Context, client *cli.PortClient, bpID string) error { - return client.CreatePermissions(ctx, client.ClientID, fmt.Sprintf("delete:blueprints:%s", bpID)) -} - -// patchBlueprintDeletePermission is a workaround for a bug where the creator of a blueprint does not have the permission to delete it. -func patchBlueprintUpdatePermission(ctx context.Context, client *cli.PortClient, bpID string) error { - return client.CreatePermissions(ctx, client.ClientID, fmt.Sprintf("update:blueprints:%s", bpID)) -} - func deleteBlueprint(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { var diags diag.Diagnostics c := m.(*cli.PortClient) - err := patchBlueprintDeletePermission(ctx, c, d.Id()) - if err != nil { - return diag.FromErr(err) - } - err = c.DeleteBlueprint(ctx, d.Id()) + err := c.DeleteBlueprint(ctx, d.Id()) if err != nil { return diag.FromErr(err) } @@ -300,10 +285,6 @@ func createBlueprint(ctx context.Context, d *schema.ResourceData, m interface{}) } var bp *cli.Blueprint if d.Id() != "" { - err = patchBlueprintUpdatePermission(ctx, c, d.Id()) - if err != nil { - return diag.FromErr(err) - } bp, err = c.UpdateBlueprint(ctx, b, d.Id()) } else { bp, err = c.CreateBlueprint(ctx, b)