diff --git a/pkg/resources/grant_ownership_acceptance_test.go b/pkg/resources/grant_ownership_acceptance_test.go index 4d2ba7b19f9..4349225545d 100644 --- a/pkg/resources/grant_ownership_acceptance_test.go +++ b/pkg/resources/grant_ownership_acceptance_test.go @@ -721,7 +721,7 @@ func TestAcc_GrantOwnership_OnPipe(t *testing.T) { Name: sdk.NewSchemaObjectIdentifierFromFullyQualifiedName(pipeFullyQualifiedName), }, }, - // TODO: Fix this identifier + // TODO(): Fix this identifier }, sdk.ObjectTypePipe, accountRoleName, fmt.Sprintf("%s\".\"%s\".%s", acc.TestDatabaseName, acc.TestSchemaName, pipeName)), ), }, diff --git a/pkg/sdk/grants_impl.go b/pkg/sdk/grants_impl.go index ffcd944eafc..b36b9ca46e2 100644 --- a/pkg/sdk/grants_impl.go +++ b/pkg/sdk/grants_impl.go @@ -292,7 +292,7 @@ func (v *grants) grantOwnershipOnPipe(ctx context.Context, pipeId SchemaObjectId } canOperateOnPipe := slices.ContainsFunc(currentGrants, func(grant Grant) bool { - return grant.Privilege == "OWNERSHIP" || grant.Privilege == SchemaObjectPrivilegeOperate.String() && grant.GranteeName == currentRoleName + return grant.GranteeName == currentRoleName && (grant.Privilege == "OWNERSHIP" || grant.Privilege == SchemaObjectPrivilegeOperate.String()) }) var revokeOperate func() error