summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/ci/runner/delete.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/ci/runner/delete.rb')
-rw-r--r--app/graphql/mutations/ci/runner/delete.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/graphql/mutations/ci/runner/delete.rb b/app/graphql/mutations/ci/runner/delete.rb
index 21c3d55881c..1713ec0bf6d 100644
--- a/app/graphql/mutations/ci/runner/delete.rb
+++ b/app/graphql/mutations/ci/runner/delete.rb
@@ -17,20 +17,11 @@ module Mutations
def resolve(id:, **runner_attrs)
runner = authorized_find!(id)
- error = authenticate_delete_runner!(runner)
- return { errors: [error] } if error
-
- ::Ci::UnregisterRunnerService.new(runner).execute
+ ::Ci::Runners::UnregisterRunnerService.new(runner, current_user).execute
{ errors: runner.errors.full_messages }
end
- def authenticate_delete_runner!(runner)
- return if current_user.can_admin_all_resources?
-
- "Runner #{runner.to_global_id} associated with more than one project" if runner.runner_projects.count > 1
- end
-
def find_object(id)
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883