Module: ForemanRemoteExecution::JobTemplatesExtensions

Defined in:
app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb

Instance Method Summary collapse

Instance Method Details

#permitted_actions(template) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb', line 3

def permitted_actions(template)
  original = super(template)

  if template.is_a?(JobTemplate)
    original.unshift(authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Run'), hash_for_new_job_invocation_path(:template_id => template.id).merge(:authorizer => authorizer)) : nil) unless template.snippet
  end

  original
end