summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 15:09:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 15:09:24 +0000
commitf8d15ca65390475e356b06dedc51e10ccd179f86 (patch)
treeef916d4e8e11c9e00d809e5cdcf63814e86d6e89 /app/serializers
parent3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad (diff)
downloadgitlab-ce-f8d15ca65390475e356b06dedc51e10ccd179f86.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/cluster_application_entity.rb2
-rw-r--r--app/serializers/merge_request_widget_entity.rb3
-rw-r--r--app/serializers/serverless/domain_entity.rb8
3 files changed, 12 insertions, 1 deletions
diff --git a/app/serializers/cluster_application_entity.rb b/app/serializers/cluster_application_entity.rb
index 632718df780..ac59a9df9e5 100644
--- a/app/serializers/cluster_application_entity.rb
+++ b/app/serializers/cluster_application_entity.rb
@@ -13,4 +13,6 @@ class ClusterApplicationEntity < Grape::Entity
expose :modsecurity_enabled, if: -> (e, _) { e.respond_to?(:modsecurity_enabled) }
expose :update_available?, as: :update_available, if: -> (e, _) { e.respond_to?(:update_available?) }
expose :can_uninstall?, as: :can_uninstall
+ expose :available_domains, using: Serverless::DomainEntity, if: -> (e, _) { e.respond_to?(:available_domains) }
+ expose :pages_domain, using: Serverless::DomainEntity, if: -> (e, _) { e.respond_to?(:pages_domain) }
end
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb
index c48e60064ed..6df26de529d 100644
--- a/app/serializers/merge_request_widget_entity.rb
+++ b/app/serializers/merge_request_widget_entity.rb
@@ -94,7 +94,8 @@ class MergeRequestWidgetEntity < Grape::Entity
merge_request.source_project&.uses_default_ci_config? &&
merge_request.all_pipelines.none? &&
merge_request.commits_count.positive? &&
- can?(current_user, :push_code, merge_request.source_project)
+ can?(current_user, :read_build, merge_request.source_project) &&
+ can?(current_user, :create_pipeline, merge_request.source_project)
end
end
diff --git a/app/serializers/serverless/domain_entity.rb b/app/serializers/serverless/domain_entity.rb
new file mode 100644
index 00000000000..556e3c99eee
--- /dev/null
+++ b/app/serializers/serverless/domain_entity.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+module Serverless
+ class DomainEntity < Grape::Entity
+ expose :id
+ expose :domain
+ end
+end