foreman_virt_who_configure 0.5.23 → 0.5.24
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0486a196b4c78fe513762dcd53fc4fad62c15811c42f2b2d15aa5de04f77a695'
|
4
|
+
data.tar.gz: a563363ed91d36d18c593f51bba58bc574670a2724f14e710a37bcd390555c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a79cc021acba1a95b90c4636c8741169466498f17000c8778b92956a1522e28d939dcb53e88702e29391662e3f6d74d87dbe8eb7a81d99f78665b146347f2b54
|
7
|
+
data.tar.gz: 9e3a8d98ab7bd30db563e003f3ab0cea7c8aa49046187cddcc612fbae19d24eae1edc7e5865c765c17dc540dcdb43b429c522046051b66cb4654b9a458511db7
|
@@ -4,12 +4,6 @@ module ForemanVirtWhoConfigure
|
|
4
4
|
class Engine < ::Rails::Engine
|
5
5
|
engine_name 'foreman_virt_who_configure'
|
6
6
|
|
7
|
-
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
|
8
|
-
config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
|
9
|
-
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
10
|
-
config.autoload_paths += Dir["#{config.root}/app/lib"]
|
11
|
-
config.autoload_paths += Dir["#{config.root}/test/"]
|
12
|
-
|
13
7
|
# Add any db migrations
|
14
8
|
initializer 'foreman_virt_who_configure.load_app_instance_data' do |app|
|
15
9
|
ForemanVirtWhoConfigure::Engine.paths['db/migrate'].existent.each do |path|
|
@@ -25,58 +19,60 @@ module ForemanVirtWhoConfigure
|
|
25
19
|
Apipie.configuration.checksum_path += ['/api/']
|
26
20
|
end
|
27
21
|
|
28
|
-
initializer 'foreman_virt_who_configure.register_plugin', :before => :finisher_hook do |
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
22
|
+
initializer 'foreman_virt_who_configure.register_plugin', :before => :finisher_hook do |app|
|
23
|
+
app.reloader.to_prepare do
|
24
|
+
Foreman::Plugin.register :foreman_virt_who_configure do
|
25
|
+
requires_foreman '>= 3.13'
|
26
|
+
register_gettext
|
27
|
+
|
28
|
+
apipie_documented_controllers ["#{ForemanVirtWhoConfigure::Engine.root}/app/controllers/foreman_virt_who_configure/api/v2/*.rb"]
|
29
|
+
|
30
|
+
# Add permissions
|
31
|
+
security_block :foreman_virt_who_configure do
|
32
|
+
permission_options = { :resource_type => 'ForemanVirtWhoConfigure::Config' }
|
33
|
+
permission :view_virt_who_config, { :'foreman_virt_who_configure/configs' => [:index, :show, :auto_complete_search, :deploy_script],
|
34
|
+
:'foreman_virt_who_configure/api/v2/configs' => [:index, :show, :deploy_script] }, permission_options
|
35
|
+
permission :create_virt_who_config, { :'foreman_virt_who_configure/configs' => [:new, :create],
|
36
|
+
:'foreman_virt_who_configure/api/v2/configs' => [:create] }, permission_options
|
37
|
+
permission :edit_virt_who_config, { :'foreman_virt_who_configure/configs' => [:edit, :update],
|
38
|
+
:'foreman_virt_who_configure/api/v2/configs' => [:update] }, permission_options
|
39
|
+
permission :destroy_virt_who_config, { :'foreman_virt_who_configure/configs' => [:destroy],
|
40
|
+
:'foreman_virt_who_configure/api/v2/configs' => [:destroy] }, permission_options
|
41
|
+
end
|
47
42
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
reporter_permissions = [:create_hosts, :edit_hosts, :view_lifecycle_environments, :my_organizations]
|
44
|
+
begin
|
45
|
+
if Permission.where(:name => ['create_content_hosts', 'edit_content_hosts']).count > 0
|
46
|
+
# old Katello permissions detected (6.2 era)
|
47
|
+
reporter_permissions += [:create_content_hosts, :edit_content_hosts]
|
48
|
+
end
|
49
|
+
rescue ActiveRecord::StatementInvalid
|
50
|
+
# permissions could not be loaded, probably migration hasn't been run yet
|
53
51
|
end
|
54
|
-
rescue ActiveRecord::StatementInvalid
|
55
|
-
# permissions could not be loaded, probably migration hasn't been run yet
|
56
|
-
end
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
53
|
+
begin
|
54
|
+
role 'Virt-who Reporter', reporter_permissions, 'Role granting minimal set of permissions for virt-who to upload the report, it can be used if you configure virt-who manually and want to use user that has locked down account.'
|
55
|
+
rescue ArgumentError
|
56
|
+
# could not configure role, some permissions are missing
|
57
|
+
end
|
63
58
|
|
64
|
-
|
59
|
+
role 'Virt-who Manager', [:view_virt_who_config, :create_virt_who_config, :edit_virt_who_config, :destroy_virt_who_config], 'Role granting all permissions to manage virt-who configurations, user needs this role to create, delete or update configurations.'
|
65
60
|
|
66
|
-
|
61
|
+
role 'Virt-who Viewer', [:view_virt_who_config], 'Role granting permissions to see all configurations including their configuration scripts, which means viewers could still deploy the virt-who instances for existing virt-who configurations.'
|
67
62
|
|
68
|
-
|
69
|
-
|
63
|
+
# Available since Foreman 1.15
|
64
|
+
add_all_permissions_to_default_roles if respond_to?(:add_all_permissions_to_default_roles)
|
70
65
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
66
|
+
# add menu entry
|
67
|
+
menu :top_menu, :virt_who_configs,
|
68
|
+
url_hash: { controller: 'foreman_virt_who_configure/configs', action: :index },
|
69
|
+
caption: N_('Virt-who Configurations'),
|
70
|
+
parent: :infrastructure_menu,
|
71
|
+
after: :compute_resources
|
77
72
|
|
78
|
-
|
79
|
-
|
73
|
+
# add dashboard widget
|
74
|
+
widget 'foreman_virt_who_configs_status_widget', :name => N_('Virt-who Configs Status'), sizex: 6, sizey: 1
|
75
|
+
end
|
80
76
|
end
|
81
77
|
end
|
82
78
|
|
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.5.
|
4
|
+
version: 0.5.24
|
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: 2024-
|
11
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- app/views/foreman_virt_who_configure/configs/steps/_schedule_form.erb
|
134
134
|
- app/views/foreman_virt_who_configure/configs/welcome.html.erb
|
135
135
|
- config/database.yml.example
|
136
|
+
- config/initializers/zeitwerk.rb
|
136
137
|
- config/routes.rb
|
137
138
|
- db/migrate/20170102152649_create_service_users.rb
|
138
139
|
- db/migrate/20170102152650_create_configs.rb
|