summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2016-08-16 12:24:03 -0500
committerRuben Davila <rdavila84@gmail.com>2016-08-16 12:24:03 -0500
commit7f853e2245eff92c037af5e007163d3e9631888d (patch)
treef235958bee27285654db1d5e71c30a500bb08c6a /app
parent07d5759408000ff46088ad886df149e21faf676f (diff)
parent9ef8de2fb7c0fca8014594c90bc199f11f92402d (diff)
downloadgitlab-ce-7f853e2245eff92c037af5e007163d3e9631888d.tar.gz
Merge remote-tracking branch 'dev/master'
Diffstat (limited to 'app')
-rw-r--r--app/controllers/import/gitlab_projects_controller.rb5
-rw-r--r--app/views/projects/new.html.haml2
2 files changed, 6 insertions, 1 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
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index adcc984f506..ea4898f2107 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -77,7 +77,7 @@
= link_to "#", class: 'btn js-toggle-button import_git' do
= icon('git', text: 'Repo by URL')
%div{ class: 'import_gitlab_project' }
- - if gitlab_project_import_enabled?
+ - if gitlab_project_import_enabled? && current_user.is_admin?
= link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit' do
= icon('gitlab', text: 'GitLab export')