Skip to content

Commit 085f907

Browse files
authored
Merge pull request #1224 from SUSE/exclude-base-product-registry-access
Check only extensions for SCC activations
2 parents 3d2197a + 98a473c commit 085f907

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

engines/registry/app/models/access_scope.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def allowed_paths(system = nil)
8787
allowed_product_classes = (active_product_classes & access_policies_yml.keys)
8888
if system && system.hybrid?
8989
# if the system is hybrid => check if the non free product subscription is still valid for accessing images
90-
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s).free? }
90+
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s, product_type: 'extension').free? }.compact
9191
unless allowed_non_free_product_classes.empty?
9292
auth_header = {
9393
'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(system.login, system.password)

engines/registry/spec/app/models/access_scope_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
system
195195
end
196196
let(:product1) do
197-
product = FactoryBot.create(:product, :with_mirrored_repositories)
197+
product = FactoryBot.create(:product, :with_mirrored_repositories, :extension)
198198
product.repositories.where(enabled: false).update(mirroring_enabled: false)
199199
product.update(product_class: 'SLES15-SP4-LTSS-X86')
200200
product

0 commit comments

Comments
 (0)