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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-25 12:08:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-25 12:08:11 +0300
commit5064bf8c5647d4c4430cbb4d097cf1592416de29 (patch)
treed051bf2abe2cc7061b3a7facb6669a56ccb9cf54 /app/helpers
parent9c83aadd2604e7e6cb1f84683f951e6b12872618 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/environments_helper.rb4
-rw-r--r--app/helpers/gitlab_routing_helper.rb5
2 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb
index 6bf920448a5..68d78959407 100644
--- a/app/helpers/environments_helper.rb
+++ b/app/helpers/environments_helper.rb
@@ -50,4 +50,8 @@ module EnvironmentsHelper
"cluster-applications-documentation-path" => help_page_path('user/clusters/applications.md', anchor: 'elastic-stack')
}
end
+
+ def can_destroy_environment?(environment)
+ can?(current_user, :destroy_environment, environment)
+ end
end
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb
index 1fb0b83b010..4474534045b 100644
--- a/app/helpers/gitlab_routing_helper.rb
+++ b/app/helpers/gitlab_routing_helper.rb
@@ -4,6 +4,7 @@
module GitlabRoutingHelper
extend ActiveSupport::Concern
+ include API::Helpers::RelatedResourcesHelpers
included do
Gitlab::Routing.includes_helpers(self)
end
@@ -29,6 +30,10 @@ module GitlabRoutingHelper
metrics_project_environment_path(environment.project, environment, *args)
end
+ def environment_delete_path(environment, *args)
+ expose_path(api_v4_projects_environments_path(id: environment.project.id, environment_id: environment.id))
+ end
+
def issue_path(entity, *args)
project_issue_path(entity.project, entity, *args)
end