diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/serializers/fork_namespace_entity.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/serializers/fork_namespace_entity.rb')
-rw-r--r-- | app/serializers/fork_namespace_entity.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/serializers/fork_namespace_entity.rb b/app/serializers/fork_namespace_entity.rb index fbcdf91a1af..2be37d23a05 100644 --- a/app/serializers/fork_namespace_entity.rb +++ b/app/serializers/fork_namespace_entity.rb @@ -13,7 +13,7 @@ class ForkNamespaceEntity < Grape::Entity end expose :forked_project_path do |namespace, options| - if forked_project = namespace.find_fork_of(options[:project]) + if forked_project = options.dig(:forked_projects, namespace.id) project_path(forked_project) end end @@ -31,7 +31,11 @@ class ForkNamespaceEntity < Grape::Entity end expose :can_create_project do |namespace, options| - options[:current_user].can?(:create_projects, namespace) + if Feature.enabled?(:fork_project_form, options[:project], default_enabled: :yaml) + true + else + options[:current_user].can?(:create_projects, namespace) + end end private |