summaryrefslogtreecommitdiff
path: root/app/controllers/projects/deploy_keys_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/deploy_keys_controller.rb')
-rw-r--r--app/controllers/projects/deploy_keys_controller.rb65
1 files changed, 0 insertions, 65 deletions
diff --git a/app/controllers/projects/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb
deleted file mode 100644
index 6fba3ce299b..00000000000
--- a/app/controllers/projects/deploy_keys_controller.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-class Projects::DeployKeysController < Projects::ApplicationController
- respond_to :html
-
- # Authorize
- before_filter :authorize_admin_project!
-
- layout "project_settings"
-
- def index
- @enabled_keys = @project.deploy_keys
-
- @available_keys = accessible_keys - @enabled_keys
- @available_project_keys = current_user.project_deploy_keys - @enabled_keys
- @available_public_keys = DeployKey.are_public - @enabled_keys
-
- # Public keys that are already used by another accessible project are already
- # in @available_project_keys.
- @available_public_keys -= @available_project_keys
- end
-
- def show
- @key = @project.deploy_keys.find(params[:id])
- end
-
- def new
- @key = @project.deploy_keys.new
-
- respond_with(@key)
- end
-
- def create
- @key = DeployKey.new(deploy_key_params)
-
- if @key.valid? && @project.deploy_keys << @key
- redirect_to namespace_project_deploy_keys_path(@project.namespace,
- @project)
- else
- render "new"
- end
- end
-
- def enable
- @key = accessible_keys.find(params[:id])
- @project.deploy_keys << @key
-
- redirect_to namespace_project_deploy_keys_path(@project.namespace,
- @project)
- end
-
- def disable
- @project.deploy_keys_projects.find_by(deploy_key_id: params[:id]).destroy
-
- redirect_to :back
- end
-
- protected
-
- def accessible_keys
- @accessible_keys ||= current_user.accessible_deploy_keys
- end
-
- def deploy_key_params
- params.require(:deploy_key).permit(:key, :title)
- end
-end