foreman_setup 1.0.4 → 2.0.0

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
  SHA1:
3
- metadata.gz: da5e328806b88cd3747ffbc70cae928ce9c5c8b2
4
- data.tar.gz: e9e716397bd1c04ebfa7264dc4a18000d84b2211
3
+ metadata.gz: 5dcdedbef7bdb8de44908f4043e201d11bfdbd49
4
+ data.tar.gz: 37b24908a75c247c024f8416f1dfc499792591ca
5
5
  SHA512:
6
- metadata.gz: eddc32856664befabe4461e7e6abc8fc70727daababd8d65c022067df211674ad6123bf2ebb05647c1eba923ee8be16ea12660e72108bab80a18b07a5765e66b
7
- data.tar.gz: 7f3c04ade6e8c10a592492334c40eb9d496c7748e63a640b544c5e1bb548dc290142223a44b4e3a3b1d25adf6114b8a6eb40fbba73191e96c5592ac45e5e9fb9
6
+ metadata.gz: 5c9f82d19bf197bfd150b384cc5eeefa5425cf6f7ec0e71e81971f5fa4455f0b61f9eb4da5e90bae36c6c20bc58ffae85a309aa7de21303ff3b249756c7fd3a7
7
+ data.tar.gz: 2a23e156c06ec9154dc82b735b24b3279f4d473c7da4cc42b8be0616143cb8eba1d86ed9c7e168330e5ffbf6b2177435e938edb2e4807e1b1d032110de8e27fc
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.0.0
4
+ * add support for Foreman 1.5 auth system (#4538)
5
+ * this version (2.x) drops support for Foreman 1.4 and earlier
6
+ * update menu references for Foreman 1.4 (Jean-Baptiste Rouault)
7
+
3
8
  ## v1.0.4
4
9
  * further Foreman 1.4 fixes, template renames and CSS
5
10
 
@@ -201,7 +201,7 @@ module ForemanSetup
201
201
  end
202
202
 
203
203
  def find_resource
204
- @provisioner = Provisioner.find(params[:id]) or raise('unknown id')
204
+ @provisioner = Provisioner.authorized(:edit_provisioning).find(params[:id]) or raise('unknown id')
205
205
  end
206
206
 
207
207
  end
@@ -2,7 +2,7 @@ require 'ipaddr'
2
2
 
3
3
  module ForemanSetup
4
4
  class Provisioner < ActiveRecord::Base
5
- include ::Authorization
5
+ include ::Authorizable
6
6
  include ::Host::Hostmix
7
7
 
8
8
  before_save :populate_hostgroup
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p>
12
- <%= _("The configuration set up is all accessible under the More menu, e.g. More > Provisioning > Subnets, and can be changed in the web interface. You can return to this set up process through <b>More > Provisioning > Provisioning Setup</b> to change settings or add new provisioning capabilities.").html_safe %>
12
+ <%= _("The configuration set up is all accessible under the Infrastructure menu, e.g. Infrastructure > Subnets, and can be changed in the web interface. You can return to this set up process through <b>Infrastructure > Provisioning Setup</b> to change settings or add new provisioning capabilities.").html_safe %>
13
13
  </p>
14
14
 
15
15
  <h4><%= _("Next steps") %></h4>
@@ -0,0 +1,10 @@
1
+ class UpdateForemanSetupPermissions < ActiveRecord::Migration
2
+ def self.up
3
+ old_permission = ::Permission.where(:name => "edit_provisioning", :resource_type => nil).first
4
+ new_permission = ::Permission.where(:name => "edit_provisioning", :resource_type => "ForemanSetup::Provisioner").first
5
+ unless old_permission.nil?
6
+ Filtering.where(:permission_id => old_permission.id).update_all(:permission_id => new_permission.id)
7
+ old_permission.delete
8
+ end
9
+ end
10
+ end
@@ -15,16 +15,19 @@ module ForemanSetup
15
15
 
16
16
  initializer 'foreman_setup.register_plugin', :after=> :finisher_hook do |app|
17
17
  Foreman::Plugin.register :foreman_setup do
18
+ requires_foreman '> 1.4'
19
+
18
20
  menu :top_menu, :provisioners, :url_hash => {:controller=> :'foreman_setup/provisioners', :action=>:index},
19
21
  :caption=> N_('Provisioning setup'),
20
22
  :parent => :infrastructure_menu,
21
23
  :first => true
22
24
 
23
25
  security_block :provisioning do
24
- permission :edit_provisioning, {:'foreman_setup/provisioners' => [:index, :new, :update, :create, :show, :destroy, :step1, :step2, :step2_update, :step3, :step4, :step4_update, :step5] }
26
+ permission :edit_provisioning, {:'foreman_setup/provisioners' => [:index, :new, :update, :create, :show, :destroy, :step1,
27
+ :step2, :step2_update, :step3, :step4, :step4_update, :step5] }, :resource_type => "ForemanSetup::Provisioner"
25
28
  end
26
29
  role "Provisioning setup", [:edit_provisioning]
27
- end if defined? Foreman::Plugin
30
+ end
28
31
  end
29
32
 
30
33
  config.to_prepare do
@@ -1,3 +1,3 @@
1
1
  module ForemanSetup
2
- VERSION = '1.0.4'
2
+ VERSION = '2.0.0'
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<"
17
+ - - <
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "<"
24
+ - - <
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  description: Plugin for Foreman that helps set up provisioning.
@@ -59,6 +59,7 @@ files:
59
59
  - db/migrate/20131023140100_add_provisioners.rb
60
60
  - db/migrate/20131025180600_add_provisioners_hostgroup.rb
61
61
  - db/migrate/20131028161000_add_provisioners_domain.rb
62
+ - db/migrate/20140305165000_update_foreman_setup_permissions.rb
62
63
  - lib/foreman_setup.rb
63
64
  - lib/foreman_setup/engine.rb
64
65
  - lib/foreman_setup/version.rb
@@ -72,17 +73,17 @@ require_paths:
72
73
  - lib
73
74
  required_ruby_version: !ruby/object:Gem::Requirement
74
75
  requirements:
75
- - - ">="
76
+ - - '>='
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  required_rubygems_version: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - ">="
81
+ - - '>='
81
82
  - !ruby/object:Gem::Version
82
83
  version: '0'
83
84
  requirements: []
84
85
  rubyforge_project:
85
- rubygems_version: 2.2.1
86
+ rubygems_version: 2.0.6
86
87
  signing_key:
87
88
  specification_version: 4
88
89
  summary: Helps set up Foreman for provisioning