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 'app/graphql/mutations/work_items/create.rb')
-rw-r--r--app/graphql/mutations/work_items/create.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/graphql/mutations/work_items/create.rb b/app/graphql/mutations/work_items/create.rb
index 7ce508e5ef1..754b453ce5d 100644
--- a/app/graphql/mutations/work_items/create.rb
+++ b/app/graphql/mutations/work_items/create.rb
@@ -60,6 +60,7 @@ module Mutations
def resolve(project_path: nil, namespace_path: nil, **attributes)
container_path = project_path || namespace_path
container = authorized_find!(container_path)
+ check_env_feature_available!(container)
check_feature_available!(container)
params = global_id_compatibility_params(attributes).merge(author_id: current_user.id)
@@ -83,6 +84,15 @@ module Mutations
private
+ # This is just a temporary measure while we migrate and backfill epic internal_ids
+ # More info in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139367
+ def check_env_feature_available!(container)
+ return unless container.is_a?(::Group) && Rails.env.production?
+
+ message = 'Group level work items are disabled. Only project paths allowed in `namespacePath`.'
+ raise Gitlab::Graphql::Errors::ArgumentError, message
+ end
+
def check_feature_available!(container)
return unless container.is_a?(::Group) && Feature.disabled?(:namespace_level_work_items, container)