diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-01-06 13:59:10 +0100 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-01-06 15:13:14 +0100 |
commit | b78ac977eeb8d631ff6c56674d8c081a3249138b (patch) | |
tree | 96e1ce80845578485c2229d8e51e940910f9ac44 /app/controllers | |
parent | 1aa2ac13b95b9fa9527596610bb07e132dc1a6f0 (diff) | |
download | gitlab-ce-b78ac977eeb8d631ff6c56674d8c081a3249138b.tar.gz |
Move settings operations controller from EE to CEmove-settings-oprations-to-ce
This commit prepares the structure for the upcoming feature error
tracking.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/settings/operations_controller.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/controllers/projects/settings/operations_controller.rb b/app/controllers/projects/settings/operations_controller.rb new file mode 100644 index 00000000000..ae8ac61ad46 --- /dev/null +++ b/app/controllers/projects/settings/operations_controller.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Projects + module Settings + class OperationsController < Projects::ApplicationController + before_action :check_license + before_action :authorize_update_environment! + + def show + end + + def update + result = ::Projects::Operations::UpdateService.new(project, current_user, update_params).execute + + if result[:status] == :success + flash[:notice] = _('Your changes have been saved') + redirect_to project_settings_operations_path(@project) + else + render 'show' + end + end + + private + + def update_params + params.require(:project).permit(permitted_project_params) + end + + # overridden in EE + def permitted_project_params + {} + end + + def check_license + render_404 unless helpers.settings_operations_available? + end + end + end +end |