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