Sha256: cf781f97ddf89f24565a9a998ddadbbd7bb71ef4a3f452d5e0961994ea20ca19

Contents?: true

Size: 560 Bytes

Versions: 7

Compression:

Stored size: 560 Bytes

Contents

module ForemanRemoteExecution
  module JobTemplatesExtensions
    extend ActiveSupport::Concern

    included do
      alias_method_chain :permitted_actions, :run_button
    end

    def permitted_actions_with_run_button(template)
      original = permitted_actions_without_run_button(template)

      if template.is_a?(JobTemplate)
        original.unshift(display_link_if_authorized(_('Run'), hash_for_new_job_invocation_path(:template_id => template.id).merge(:authorizer => authorizer))) unless template.snippet
      end

      original
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.6 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.5 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.3 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.2 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.1 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
foreman_remote_execution-1.3.0 app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb