7be7f570dc
Admins would be prevented from adding a project deploy key since the accessible keys would be restricted to the user's keys. Also backports a spec for DeployKeysController from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8432.
13 lines
350 B
Ruby
13 lines
350 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Projects
|
|
class DisableDeployKeyService < BaseService
|
|
def execute
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
deploy_key_project = project.deploy_keys_projects.find_by(deploy_key_id: params[:id])
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
|
|
deploy_key_project&.destroy!
|
|
end
|
|
end
|
|
end
|