diff --git a/backend/remote/backend_apply.go b/backend/remote/backend_apply.go index 8cd5155f5..5596020d7 100644 --- a/backend/remote/backend_apply.go +++ b/backend/remote/backend_apply.go @@ -18,7 +18,9 @@ func (b *Remote) opApply(stopCtx, cancelCtx context.Context, op *backend.Operati var diags tfdiags.Diagnostics - if !w.Permissions.CanUpdate { + // We should remove the `CanUpdate` part of this test, but for now + // (to remain compatible with tfe.v2.1) we'll leave it in here. + if !w.Permissions.CanUpdate && !w.Permissions.CanQueueApply { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, "Insufficient rights to apply changes", diff --git a/backend/remote/backend_mock.go b/backend/remote/backend_mock.go index b623c04bd..dfd9079bd 100644 --- a/backend/remote/backend_mock.go +++ b/backend/remote/backend_mock.go @@ -972,6 +972,15 @@ func (m *mockWorkspaces) Delete(ctx context.Context, organization, workspace str return nil } +func (m *mockWorkspaces) RemoveVCSConnection(ctx context.Context, organization, workspace string) (*tfe.Workspace, error) { + w, ok := m.workspaceNames[workspace] + if !ok { + return nil, tfe.ErrResourceNotFound + } + w.VCSRepo = nil + return w, nil +} + func (m *mockWorkspaces) Lock(ctx context.Context, workspaceID string, options tfe.WorkspaceLockOptions) (*tfe.Workspace, error) { w, ok := m.workspaceIDs[workspaceID] if !ok {