From b57afe7e1978948b8ea3669039adab60dbe1c3f4 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Wed, 29 Nov 2023 10:00:00 +0000 Subject: [PATCH] Fixes #36955 - Revert back 'Change Puppet CA' action refs: 6cdb8c7a9ebd790537510213e43537a4a87189d6 --- app/helpers/puppet_related_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/helpers/puppet_related_helper.rb diff --git a/app/helpers/puppet_related_helper.rb b/app/helpers/puppet_related_helper.rb new file mode 100644 index 00000000000..dff70725efc --- /dev/null +++ b/app/helpers/puppet_related_helper.rb @@ -0,0 +1,13 @@ +module PuppetRelatedHelper + UI.register_host_description do + multiple_actions_provider :puppet_actions + end + + def puppet_actions + return [] unless Foreman::Plugin.installed?('foreman_puppet') + return [] unless authorized_for(:controller => :hosts, :action => :edit) + return [] unless SmartProxy.unscoped.authorized.with_features("Puppet CA").exists? + + [{ :action => [_('Change Puppet CA'), select_multiple_puppet_ca_proxy_hosts_path], :priority => 1051 }] + end +end