foreman_puppet 9.1.0 → 10.0.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc7813b3e70470b1ede75609466fd1f395b2b24415a6fc30dea85fcf9431c10a
|
|
4
|
+
data.tar.gz: 3f6e2c28bdb0143c86e1182b201afb8eb81a9753c0fcd8198c5bf4996a3e995f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c2df904975315458ad27f09262c0025c9240d8750b89f2325a86bcd53abbd7c9e8d4d5ded37aebe594b069b86f3e0697be806652bfba01a8a42931a2b38cbca
|
|
7
|
+
data.tar.gz: 9708de0a826955c059856924d0fd206d76b2b21f8905e450b030c8876659f7f02692520cea3888701028e330947c4e556f1741dd3f21f6397124b1dc2281b1a9
|
|
@@ -9,19 +9,7 @@ module ForemanPuppet
|
|
|
9
9
|
|
|
10
10
|
module PatchedMethods
|
|
11
11
|
def visible_environments
|
|
12
|
-
|
|
13
|
-
authorized_scope = authorized_scope
|
|
14
|
-
.joins(:taxable_taxonomies)
|
|
15
|
-
.where('taxable_taxonomies.taxonomy_id' => taxonomy_ids[:organizations] + taxonomy_ids[:locations])
|
|
16
|
-
result = authorized_scope.distinct.pluck(:name)
|
|
17
|
-
if ::User.current.admin?
|
|
18
|
-
# Admin users can also see Environments that do not have any organization or location, even when
|
|
19
|
-
# organizations and locations are enabled.
|
|
20
|
-
untaxed_env_ids = TaxableTaxonomy.where(taxable_type: 'ForemanPuppet::Environment').distinct.select(:taxable_id)
|
|
21
|
-
untaxed_environments = ForemanPuppet::Environment.unscoped.where.not(id: untaxed_env_ids).pluck(:name)
|
|
22
|
-
result += untaxed_environments
|
|
23
|
-
end
|
|
24
|
-
result
|
|
12
|
+
ForemanPuppet::Environment.authorized(:view_environments).pluck(:name)
|
|
25
13
|
end
|
|
26
14
|
end
|
|
27
15
|
end
|
|
@@ -24,8 +24,12 @@ module ForemanPuppet
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
test 'should show the list of environments visible as non-admin user' do
|
|
27
|
-
# Non-admin user only sees environments in
|
|
27
|
+
# Non-admin user only sees environments in the same taxonomies at least
|
|
28
28
|
setup_user 'view', 'environments'
|
|
29
|
+
# The user is in the same location as the environment, but in a
|
|
30
|
+
# different org. The org mismatch would make the environment invisible
|
|
31
|
+
# to the user.
|
|
32
|
+
User.current.organizations << environment.organizations.first
|
|
29
33
|
assert_equal [environment.name], ::User.current.visible_environments
|
|
30
34
|
end
|
|
31
35
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_puppet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 10.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ondřej Ezr
|
|
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
404
404
|
- !ruby/object:Gem::Version
|
|
405
405
|
version: '0'
|
|
406
406
|
requirements: []
|
|
407
|
-
rubygems_version:
|
|
407
|
+
rubygems_version: 4.0.6
|
|
408
408
|
specification_version: 4
|
|
409
409
|
summary: Add Puppet features to Foreman
|
|
410
410
|
test_files:
|