foreman_virt_who_configure 0.1.5 → 0.1.6
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 +4 -4
- data/app/controllers/foreman_virt_who_configure/api/v2/configs_controller.rb +4 -0
- data/app/controllers/foreman_virt_who_configure/configs_controller.rb +4 -0
- data/app/helpers/foreman_virt_who_configure/compatibility_helper.rb +2 -2
- data/app/models/foreman_virt_who_configure/output_generator.rb +1 -1
- data/app/services/foreman_virt_who_configure/cleaner.rb +21 -0
- data/app/views/foreman_virt_who_configure/configs/index.html.erb +3 -3
- data/app/views/foreman_virt_who_configure/configs/show.html.erb +1 -1
- data/lib/foreman_virt_who_configure/version.rb +1 -1
- data/lib/tasks/foreman_virt_who_configure_tasks.rake +3 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b47a2020307dc453ed4b12012eb386bb82b4053
|
4
|
+
data.tar.gz: fa463aa1e278c5af50b1429bda158e25e0fbd7bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e366d45ad3a8f7cc2102787e23d013a1f27fd165dcc69c3fd15bea4f8bb83978b125b331808aeb670795ef3f360aaddb2c2782a85d8ccf3c3f01991de8dcdee6
|
7
|
+
data.tar.gz: 5ae7f7599c8273cd49eb3f41e3e2bd29c8aa66dedfe15ef3ef9554b19d83b29588514321ef9542410b7c74e20212d818b38b829de6e57300414a2fbb020cccfa
|
@@ -4,9 +4,9 @@ module ForemanVirtWhoConfigure
|
|
4
4
|
|
5
5
|
def new_config_link(options = {}, html_options = {})
|
6
6
|
if ApplicationHelper.instance_methods.include?(:new_link)
|
7
|
-
new_link(_("Create Config"), options, html_options)
|
7
|
+
new_link(_("Create Config"), options.merge(:permission => 'create_virt_who_config'), html_options)
|
8
8
|
else
|
9
|
-
display_link_if_authorized(_("New Config"), hash_for_new_foreman_virt_who_configure_config_path, html_options)
|
9
|
+
display_link_if_authorized(_("New Config"), hash_for_new_foreman_virt_who_configure_config_path.merge(:permission => 'create_virt_who_config'), html_options)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module ForemanVirtWhoConfigure
|
2
|
+
class Cleaner
|
3
|
+
def clean_up!
|
4
|
+
User.as_anonymous_admin do
|
5
|
+
remove_configurations
|
6
|
+
remove_hidden_auth_sources
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def remove_hidden_auth_sources
|
13
|
+
AuthSourceHiddenWithAuthentication.destroy_all
|
14
|
+
end
|
15
|
+
|
16
|
+
# also removes service users
|
17
|
+
def remove_configurations
|
18
|
+
Config.destroy_all
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -14,12 +14,12 @@
|
|
14
14
|
<tbody>
|
15
15
|
<% @configs.each do |config| %>
|
16
16
|
<tr>
|
17
|
-
<td class="display-two-pane ellipsis"><%= link_to_if_authorized config.name, hash_for_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer) %></td>
|
17
|
+
<td class="display-two-pane ellipsis"><%= link_to_if_authorized config.name, hash_for_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer, :permission => 'view_virt_who_config') %></td>
|
18
18
|
<td><%= config.humanized_interval %></td>
|
19
19
|
<td><%= config_report_status(config) %></td>
|
20
20
|
<td class="col-md-1"><%= action_buttons(
|
21
|
-
display_link_if_authorized(_('Edit'), hash_for_edit_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer)),
|
22
|
-
display_delete_if_authorized((hash_for_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer)), :data => {
|
21
|
+
display_link_if_authorized(_('Edit'), hash_for_edit_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer, :permission => 'edit_virt_who_config')),
|
22
|
+
display_delete_if_authorized((hash_for_foreman_virt_who_configure_config_path(:id => config).merge(:auth_object => config, :authorizer => authorizer, :permission => 'destroy_virt_who_config')), :data => {:confirm => _("Delete virt-who configuration %s?") % config.name})
|
23
23
|
) %></td>
|
24
24
|
</tr>
|
25
25
|
<% end %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<div class="col-md-2">
|
14
14
|
<div class="pull-right">
|
15
15
|
<p>
|
16
|
-
<%=
|
16
|
+
<%= display_link_if_authorized _('Edit this configuration'), hash_for_edit_foreman_virt_who_configure_config_path(@config).merge(:permission => 'show_virt_who_config', :auth_object => @config), :class => 'btn btn-default' %>
|
17
17
|
</p>
|
18
18
|
</div>
|
19
19
|
</div>
|
@@ -2,11 +2,9 @@ require 'rake/testtask'
|
|
2
2
|
|
3
3
|
# Tasks
|
4
4
|
namespace :foreman_virt_who_configure do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
# Task goes here
|
9
|
-
end
|
5
|
+
desc 'Clean default data created by this plugin, this will permanently delete the data!'
|
6
|
+
task cleanup: :environment do
|
7
|
+
ForemanVirtWhoConfigure::Cleaner.new.clean_up!
|
10
8
|
end
|
11
9
|
end
|
12
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_virt_who_configure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman virt-who-configure team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- app/models/foreman_virt_who_configure/config.rb
|
77
77
|
- app/models/foreman_virt_who_configure/output_generator.rb
|
78
78
|
- app/models/foreman_virt_who_configure/service_user.rb
|
79
|
+
- app/services/foreman_virt_who_configure/cleaner.rb
|
79
80
|
- app/services/sso/basic_with_hidden.rb
|
80
81
|
- app/views/dashboard/_foreman_virt_who_configs_status_widget.html.erb
|
81
82
|
- app/views/foreman_virt_who_configure/api/v2/configs/base.json.rabl
|