diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:11 +0300 |
commit | 5064bf8c5647d4c4430cbb4d097cf1592416de29 (patch) | |
tree | d051bf2abe2cc7061b3a7facb6669a56ccb9cf54 /app/serializers | |
parent | 9c83aadd2604e7e6cb1f84683f951e6b12872618 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/environment_entity.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb index d9af7af8a8b..7da5910a75b 100644 --- a/app/serializers/environment_entity.rb +++ b/app/serializers/environment_entity.rb @@ -28,6 +28,10 @@ class EnvironmentEntity < Grape::Entity cancel_auto_stop_project_environment_path(environment.project, environment) end + expose :delete_path do |environment| + environment_delete_path(environment) + end + expose :cluster_type, if: ->(environment, _) { cluster_platform_kubernetes? } do |environment| cluster.cluster_type end @@ -63,6 +67,10 @@ class EnvironmentEntity < Grape::Entity environment.elastic_stack_available? end + expose :can_delete do |environment| + can?(current_user, :destroy_environment, environment) + end + private alias_method :environment, :object |