Commit 7019a19b authored by James Lopez's avatar James Lopez

cleanup namespace check now done by service

parent 89227126
class Import::GitlabProjectsController < Import::BaseController class Import::GitlabProjectsController < Import::BaseController
before_action :verify_gitlab_project_import_enabled before_action :verify_gitlab_project_import_enabled
before_action :verify_project_and_namespace_access
def new def new
@namespace_id = project_params[:namespace_id] @namespace_id = project_params[:namespace_id]
...@@ -36,16 +35,6 @@ class Import::GitlabProjectsController < Import::BaseController ...@@ -36,16 +35,6 @@ class Import::GitlabProjectsController < Import::BaseController
project_params[:file].respond_to?(:read) project_params[:file].respond_to?(:read)
end end
def verify_project_and_namespace_access
unless namespace_access?
render_403
end
end
def namespace_access?
can?(current_user, :create_projects, Namespace.find(project_params[:namespace_id]))
end
def verify_gitlab_project_import_enabled def verify_gitlab_project_import_enabled
render_404 unless gitlab_project_import_enabled? render_404 unless gitlab_project_import_enabled?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment