Skip to content

Commit

Permalink
Merge pull request #1224 from SUSE/exclude-base-product-registry-access
Browse files Browse the repository at this point in the history
Check only extensions for SCC activations
  • Loading branch information
jesusbv authored Sep 4, 2024
2 parents 3d2197a + 98a473c commit 085f907
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/registry/app/models/access_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def allowed_paths(system = nil)
allowed_product_classes = (active_product_classes & access_policies_yml.keys)
if system && system.hybrid?
# if the system is hybrid => check if the non free product subscription is still valid for accessing images
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s).free? }
allowed_non_free_product_classes = allowed_product_classes.map { |s| s unless Product.find_by(product_class: s, product_type: 'extension').free? }.compact
unless allowed_non_free_product_classes.empty?
auth_header = {
'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(system.login, system.password)
Expand Down
2 changes: 1 addition & 1 deletion engines/registry/spec/app/models/access_scope_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
system
end
let(:product1) do
product = FactoryBot.create(:product, :with_mirrored_repositories)
product = FactoryBot.create(:product, :with_mirrored_repositories, :extension)
product.repositories.where(enabled: false).update(mirroring_enabled: false)
product.update(product_class: 'SLES15-SP4-LTSS-X86')
product
Expand Down

0 comments on commit 085f907

Please sign in to comment.