diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 18:09:24 +0300 |
commit | f8d15ca65390475e356b06dedc51e10ccd179f86 (patch) | |
tree | ef916d4e8e11c9e00d809e5cdcf63814e86d6e89 /app/serializers | |
parent | 3ab4feda4dce9c9f0672375ae27c2f7c2ba6f4ad (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/cluster_application_entity.rb | 2 | ||||
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 3 | ||||
-rw-r--r-- | app/serializers/serverless/domain_entity.rb | 8 |
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 |