diff options
Diffstat (limited to 'app/controllers/import/base_controller.rb')
-rw-r--r-- | app/controllers/import/base_controller.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/import/base_controller.rb b/app/controllers/import/base_controller.rb index 7ad3a2ee358..51ca12370e6 100644 --- a/app/controllers/import/base_controller.rb +++ b/app/controllers/import/base_controller.rb @@ -13,7 +13,13 @@ class Import::BaseController < ApplicationController provider_repos: serialized_provider_repos, incompatible_repos: serialized_incompatible_repos } end - format.html + format.html do + if params[:namespace_id]&.present? + @namespace = Namespace.find_by_id(params[:namespace_id]) + + render_404 unless current_user.can?(:create_projects, @namespace) + end + end end end @@ -70,7 +76,7 @@ class Import::BaseController < ApplicationController end def already_added_projects - @already_added_projects ||= filtered(find_already_added_projects(provider_name)) + @already_added_projects ||= find_already_added_projects(provider_name) end # rubocop: disable CodeReuse/ActiveRecord |