Skip to content

Commit 20f6331

Browse files
authored
remove patches for permissions (#3)
1 parent c93b77a commit 20f6331

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ HOSTNAME=github.com
22
NAMESPACE=port-labs
33
NAME=port-labs
44
BINARY=terraform-provider-${NAME}
5-
VERSION=0.1.0
5+
VERSION=0.1.1
66
OS=$(shell go env GOOS)
77
ARCH=$(shell go env GOARCH)
88
OS_ARCH=${OS}_${ARCH}

port/resource_port_blueprint.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package port
22

33
import (
44
"context"
5-
"fmt"
65

76
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -238,24 +237,10 @@ func blueprintResourceToBody(d *schema.ResourceData) (*cli.Blueprint, error) {
238237
return b, nil
239238
}
240239

241-
// patchBlueprintDeletePermission is a workaround for a bug where the creator of a blueprint does not have the permission to delete it.
242-
func patchBlueprintDeletePermission(ctx context.Context, client *cli.PortClient, bpID string) error {
243-
return client.CreatePermissions(ctx, client.ClientID, fmt.Sprintf("delete:blueprints:%s", bpID))
244-
}
245-
246-
// patchBlueprintDeletePermission is a workaround for a bug where the creator of a blueprint does not have the permission to delete it.
247-
func patchBlueprintUpdatePermission(ctx context.Context, client *cli.PortClient, bpID string) error {
248-
return client.CreatePermissions(ctx, client.ClientID, fmt.Sprintf("update:blueprints:%s", bpID))
249-
}
250-
251240
func deleteBlueprint(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
252241
var diags diag.Diagnostics
253242
c := m.(*cli.PortClient)
254-
err := patchBlueprintDeletePermission(ctx, c, d.Id())
255-
if err != nil {
256-
return diag.FromErr(err)
257-
}
258-
err = c.DeleteBlueprint(ctx, d.Id())
243+
err := c.DeleteBlueprint(ctx, d.Id())
259244
if err != nil {
260245
return diag.FromErr(err)
261246
}
@@ -300,10 +285,6 @@ func createBlueprint(ctx context.Context, d *schema.ResourceData, m interface{})
300285
}
301286
var bp *cli.Blueprint
302287
if d.Id() != "" {
303-
err = patchBlueprintUpdatePermission(ctx, c, d.Id())
304-
if err != nil {
305-
return diag.FromErr(err)
306-
}
307288
bp, err = c.UpdateBlueprint(ctx, b, d.Id())
308289
} else {
309290
bp, err = c.CreateBlueprint(ctx, b)

0 commit comments

Comments
 (0)