summaryrefslogtreecommitdiff
path: root/app/serializers/environment_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/environment_entity.rb')
-rw-r--r--app/serializers/environment_entity.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index 8c6ad010d69..66ca2382901 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -19,6 +19,7 @@ class EnvironmentEntity < Grape::Entity
expose :name_without_type
expose :last_deployment, using: DeploymentEntity
expose :stop_action_available?, as: :has_stop_action
+ expose :rollout_status, if: -> (*) { can_read_deploy_board? }, using: RolloutStatusEntity
expose :upcoming_deployment, expose_nil: false do |environment, ops|
DeploymentEntity.represent(environment.upcoming_deployment,
@@ -104,6 +105,10 @@ class EnvironmentEntity < Grape::Entity
can?(current_user, :read_pod_logs, environment.project)
end
+ def can_read_deploy_board?
+ can?(current_user, :read_deploy_board, environment.project)
+ end
+
def cluster_platform_kubernetes?
deployment_platform && deployment_platform.is_a?(Clusters::Platforms::Kubernetes)
end