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:
Diffstat (limited to 'lib/bulk_imports/features.rb')
-rw-r--r--lib/bulk_imports/features.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/bulk_imports/features.rb b/lib/bulk_imports/features.rb
new file mode 100644
index 00000000000..952e8e62d71
--- /dev/null
+++ b/lib/bulk_imports/features.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module BulkImports
+ module Features
+ def self.enabled?
+ ::Feature.enabled?(:bulk_import)
+ end
+
+ def self.project_migration_enabled?(destination_namespace = nil)
+ if destination_namespace.present?
+ root_ancestor = Namespace.find_by_full_path(destination_namespace)&.root_ancestor
+
+ ::Feature.enabled?(:bulk_import_projects, root_ancestor)
+ else
+ ::Feature.enabled?(:bulk_import_projects)
+ end
+ end
+ end
+end