foreman_remote_execution 12.0.1 → 12.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6385c407f978cf02cd096ef099c9c1304da27c67afcea48e91bd484b869a2635
4
- data.tar.gz: 5997c4f5af4cc4624f3955f869e4076856918c0611da644d75a95017a5dd2dac
3
+ metadata.gz: 7d9ecaf9a67e402868291ed6ecf2d064cfa091bf2a5a3eaf2ec8e160f8e7ede5
4
+ data.tar.gz: 35186e50675ac5b48624a5cfd22d2a2617c8adac7bd2b2a547313acdea0eec29
5
5
  SHA512:
6
- metadata.gz: e24eb75f9d677836b32f4f6c4b6bb4d4b43a0934d63bb3ea80b2e66e6f9787d5792bef99ed5c01d9b1ec23547e0c5cc79660205ce3040612d940a19b64f3e8d2
7
- data.tar.gz: 1957e681e82ad9093d95949b47dec5d273b0c14f1aee46465490126dd97eb5d3f85b8335183ca56629d36fff439b7f4ae9624bbe9c236715d5e7f82fab20a6f0
6
+ metadata.gz: 33850b7431db3f15ba1168fe448eee84d9feb91b8f15d1239f6270513bcc59027a08e6600e9953705a70f05f631b70083f3cc097bce86cde721acfa33be47889
7
+ data.tar.gz: a83abe1d5a040bd019a8649db4318633bdc24a7dbb690a676ff707ba62f6356e9df4559bf2be84a36c472d54948b97c46bd6ee6691fc854d29f427d88472d0fa
@@ -4,7 +4,7 @@ module ForemanRemoteExecution
4
4
  original = super(template)
5
5
 
6
6
  if template.is_a?(JobTemplate)
7
- original.unshift(display_link_if_authorized(_('Run'), hash_for_new_job_invocation_path(:template_id => template.id).merge(:authorizer => authorizer))) unless template.snippet
7
+ 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
8
8
  end
9
9
 
10
10
  original
@@ -33,8 +33,7 @@ module RemoteExecutionHelper
33
33
  links << { title: _('Host detail'),
34
34
  action: { href: current_host_details_path(host), 'data-method': 'get', id: "#{host.name}-actions-detail" } }
35
35
  end
36
-
37
- if authorized_for(hash_for_rerun_job_invocation_path(id: job_invocation, host_ids: [ host.id ], authorizer: job_hosts_authorizer))
36
+ if authorized_for(controller: :job_invocations, action: :create) && (!host.infrastructure_host? || User.current.can?(:execute_jobs_on_infrastructure_hosts))
38
37
  links << { title: (_('Rerun on %s') % host.name),
39
38
  action: { href: rerun_job_invocation_path(job_invocation, host_ids: [ host.id ]),
40
39
  'data-method': 'get', id: "#{host.name}-actions-rerun" } }
@@ -56,7 +55,7 @@ module RemoteExecutionHelper
56
55
  def job_invocations_buttons
57
56
  [
58
57
  documentation_button_rex('3.2ExecutingaJob'),
59
- display_link_if_authorized(_('Run Job'), hash_for_new_job_invocation_path, {:class => "btn btn-primary"}),
58
+ authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Run Job'), hash_for_new_job_invocation_path, {:class => "btn btn-primary"}) : '',
60
59
  ]
61
60
  end
62
61
 
@@ -70,12 +69,12 @@ module RemoteExecutionHelper
70
69
  title: _('Create report for this job'),
71
70
  disabled: task.pending?)
72
71
  end
73
- if authorized_for(hash_for_new_job_invocation_path)
72
+ if authorized_for(controller: :job_invocations, action: :create)
74
73
  buttons << link_to(_('Rerun'), rerun_job_invocation_path(:id => job_invocation.id),
75
74
  :class => 'btn btn-default',
76
75
  :title => _('Rerun the job'))
77
76
  end
78
- if authorized_for(hash_for_new_job_invocation_path)
77
+ if authorized_for(controller: :job_invocations, action: :create)
79
78
  buttons << link_to(_('Rerun failed'), rerun_job_invocation_path(:id => job_invocation.id, :failed_only => 1),
80
79
  :class => 'btn btn-default',
81
80
  :disabled => job_invocation.failed_hosts.none?,
@@ -77,6 +77,11 @@ class JobInvocation < ApplicationRecord
77
77
  :ext_method => :search_by_recurring_logic, :only_explicit => true,
78
78
  :complete_value => { :true => true, :false => false }
79
79
 
80
+ validates :concurrency_level, :numericality => {
81
+ :allow_nil => true,
82
+ :greater_than => 0,
83
+ }
84
+
80
85
  default_scope -> { order('job_invocations.id DESC') }
81
86
 
82
87
  scope :latest_jobs, -> { unscoped.joins(:task).order('foreman_tasks_tasks.start_at DESC').authorized(:view_job_invocations).limit(5) }
@@ -2,8 +2,8 @@
2
2
  <% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
3
3
  <% title _('Job invocation') %>
4
4
  <% if(request.path_parameters[:action] == "rerun") %>
5
- <%= display_link_if_authorized(_('Use new job wizard'), hash_for_rerun_job_invocation_path({:id => request.path_parameters[:id]}).merge(request.query_parameters)) %>
5
+ <%= authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Use new job wizard'), hash_for_rerun_job_invocation_path({:id => request.path_parameters[:id]}).merge(request.query_parameters)) : nil %>
6
6
  <% else %>
7
- <%= display_link_if_authorized(_('Use new job wizard'), hash_for_new_job_invocation_path().merge(request.query_parameters)) %>
7
+ <%= authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Use new job wizard'), hash_for_new_job_invocation_path().merge(request.query_parameters)) : nil %>
8
8
  <%end%>
9
9
  <%= render :partial => 'form' %>
@@ -9,6 +9,6 @@
9
9
  <p><%= link_to _('Learn more about this in the documentation.'),
10
10
  documentation_url('1.ForemanRemoteExecution1.3Manual', :root_url => 'https://www.theforeman.org/plugins/foreman_remote_execution/1.3/index.html#'), :rel => 'external' %></p>
11
11
  <div class="blank-slate-pf-main-action">
12
- <%= display_link_if_authorized(_("Run Job"), { :action => :create }, { :class => "btn btn-primary btn-lg" }) %>
12
+ <%= authorized_for(controller: :job_invocations, action: :create) ? link_to(_("Run Job"), { :action => :create }, { :class => "btn btn-primary btn-lg" }) : nil %>
13
13
  </div>
14
14
  </div>
@@ -177,8 +177,11 @@ module ForemanRemoteExecution
177
177
  :'api/v2/job_templates' => [:update],
178
178
  :'api/v2/template_inputs' => [:create, :update, :destroy],
179
179
  :'api/v2/foreign_input_sets' => [:create, :update, :destroy]}, :resource_type => 'JobTemplate'
180
- permission :edit_remote_execution_features, { :remote_execution_features => [:index, :show, :update],
181
- :'api/v2/remote_execution_features' => [:index, :show, :update, :available_remote_execution_features]}, :resource_type => 'RemoteExecutionFeature'
180
+ permission :view_remote_execution_features, { :remote_execution_features => [:index, :show],
181
+ :'api/v2/remote_execution_features' => [:index, :show, :available_remote_execution_features]},
182
+ :resource_type => 'RemoteExecutionFeature'
183
+ permission :edit_remote_execution_features, { :remote_execution_features => [:update],
184
+ :'api/v2/remote_execution_features' => [:update ]}, :resource_type => 'RemoteExecutionFeature'
182
185
  permission :destroy_job_templates, { :job_templates => [:destroy],
183
186
  :'api/v2/job_templates' => [:destroy] }, :resource_type => 'JobTemplate'
184
187
  permission :lock_job_templates, { :job_templates => [:lock, :unlock] }, :resource_type => 'JobTemplate'
@@ -204,6 +207,7 @@ module ForemanRemoteExecution
204
207
  :create_template_invocations,
205
208
  :view_hosts,
206
209
  :view_smart_proxies,
210
+ :view_remote_execution_features,
207
211
  ].freeze
208
212
  MANAGER_PERMISSIONS = USER_PERMISSIONS + [
209
213
  :cancel_job_invocations,
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '12.0.1'.freeze
2
+ VERSION = '12.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.1
4
+ version: 12.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-04 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -575,7 +575,7 @@ homepage: https://github.com/theforeman/foreman_remote_execution
575
575
  licenses:
576
576
  - GPL-3.0
577
577
  metadata: {}
578
- post_install_message:
578
+ post_install_message:
579
579
  rdoc_options: []
580
580
  require_paths:
581
581
  - lib
@@ -593,8 +593,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
593
593
  - !ruby/object:Gem::Version
594
594
  version: '0'
595
595
  requirements: []
596
- rubygems_version: 3.1.6
597
- signing_key:
596
+ rubygems_version: 3.3.26
597
+ signing_key:
598
598
  specification_version: 4
599
599
  summary: A plugin bringing remote execution to the Foreman, completing the config
600
600
  management functionality with remote management functionality.