debian-mirror-gitlab/app/services/keys/destroy_service.rb
2021-09-30 23:02:18 +05:30

24 lines
381 B
Ruby

# frozen_string_literal: true
module Keys
class DestroyService < ::Keys::BaseService
def execute(key)
return unless destroy_possible?(key)
destroy(key)
end
private
# overridden in EE::Keys::DestroyService
def destroy_possible?(key)
true
end
def destroy(key)
key.destroy
end
end
end
Keys::DestroyService.prepend_mod