@@ -2,7 +2,6 @@ package port
2
2
3
3
import (
4
4
"context"
5
- "fmt"
6
5
7
6
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
8
7
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -238,24 +237,10 @@ func blueprintResourceToBody(d *schema.ResourceData) (*cli.Blueprint, error) {
238
237
return b , nil
239
238
}
240
239
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
-
251
240
func deleteBlueprint (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
252
241
var diags diag.Diagnostics
253
242
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 ())
259
244
if err != nil {
260
245
return diag .FromErr (err )
261
246
}
@@ -300,10 +285,6 @@ func createBlueprint(ctx context.Context, d *schema.ResourceData, m interface{})
300
285
}
301
286
var bp * cli.Blueprint
302
287
if d .Id () != "" {
303
- err = patchBlueprintUpdatePermission (ctx , c , d .Id ())
304
- if err != nil {
305
- return diag .FromErr (err )
306
- }
307
288
bp , err = c .UpdateBlueprint (ctx , b , d .Id ())
308
289
} else {
309
290
bp , err = c .CreateBlueprint (ctx , b )
0 commit comments