Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Bobbitt <ryehle@us.ibm.com>2017-08-01 00:34:47 +0300
committerRobin Bobbitt <ryehle@us.ibm.com>2017-08-11 19:22:37 +0300
commit649d042dbc9e2bfda96bb98b0eabd4b00ea2daff (patch)
tree515865c4aadfcb2cda51501ac5c8cd664d805708 /app/controllers
parent7633945c27891aa84c45735f14535462b8a54641 (diff)
Add option to disable project export on instance
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e93f34498d6..1d24563a6a6 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -7,6 +7,7 @@ class ProjectsController < Projects::ApplicationController
before_action :repository, except: [:index, :new, :create]
before_action :assign_ref_vars, only: [:show], if: :repo_exists?
before_action :tree, only: [:show], if: [:repo_exists?, :project_view_files?]
+ before_action :project_export_enabled, only: [:export, :download_export, :remove_export, :generate_new_export]
# Authorize
before_action :authorize_admin_project!, only: [:edit, :update, :housekeeping, :download_export, :export, :remove_export, :generate_new_export]
@@ -390,4 +391,8 @@ class ProjectsController < Projects::ApplicationController
url_for(params)
end
+
+ def project_export_enabled
+ render_404 unless current_application_settings.project_export_enabled?
+ end
end