summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-08-15 19:52:34 +0000
committerDouwe Maan <douwe@gitlab.com>2016-08-15 19:52:34 +0000
commit966b303802e12204f5d32af24b13bd0ceb5342a1 (patch)
tree52167d245f89e872b757bdfe868327ba76acae19 /app/controllers
parent6af598fc173bd0f7cd4237fa3e60d223103301a3 (diff)
parent30f9596c612abc19dd060fa3a8e8ae3d92001d45 (diff)
downloadgitlab-ce-966b303802e12204f5d32af24b13bd0ceb5342a1.tar.gz
Merge branch 'fix/import-permissions' into 'master'
Set permissions to admin for importing a project via Import/Export Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/20802 In order to import a project, it is now required to be an admin Moved from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5766 See merge request !1983
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/import/gitlab_projects_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb
index 3ec173abcdb..7d0eff37635 100644
--- a/app/controllers/import/gitlab_projects_controller.rb
+++ b/app/controllers/import/gitlab_projects_controller.rb
@@ -1,5 +1,6 @@
class Import::GitlabProjectsController < Import::BaseController
before_action :verify_gitlab_project_import_enabled
+ before_action :authenticate_admin!
def new
@namespace_id = project_params[:namespace_id]
@@ -47,4 +48,8 @@ class Import::GitlabProjectsController < Import::BaseController
:path, :namespace_id, :file
)
end
+
+ def authenticate_admin!
+ render_404 unless current_user.is_admin?
+ end
end