Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cluster_basic_entity.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d104f2c8bbdc77fcae30c6653dc798b70531a319 (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class ClusterBasicEntity < Grape::Entity
  include RequestAwareEntity

  expose :name
  expose :path, if: -> (cluster) { can?(request.current_user, :read_cluster, cluster) } do |cluster|
    cluster.present(current_user: request.current_user).show_path
  end
end