Skip to content

Commit

Permalink
Merge branch 'issue/OR-4477_enable_sca_by_default' into 'atix-4.11.0'
Browse files Browse the repository at this point in the history
Revert "[ATIX] Do not use simple content access by default"

See merge request orcharhino/foreman_components/katello!138
  • Loading branch information
nadjaheitmann committed Feb 8, 2024
2 parents 3908688 + a692ee3 commit e8f33c6
Show file tree
Hide file tree
Showing 15 changed files with 1,984 additions and 2,220 deletions.
4 changes: 2 additions & 2 deletions app/controllers/katello/api/v2/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def update
param :organization, Hash do
param :label, String, :required => false
end
param :simple_content_access, :bool, :desc => N_('Whether to turn on Simple Content Access for the organization.'), :required => false, :default => false, deprecated: true
param :simple_content_access, :bool, :desc => N_('Whether to turn on Simple Content Access for the organization.'), :required => false, :default => true, deprecated: true
def create
@organization = Organization.new(resource_params)
sca = params.key?(:simple_content_access) ? ::Foreman::Cast.to_bool(params[:simple_content_access]) : false
sca = params.key?(:simple_content_access) ? ::Foreman::Cast.to_bool(params[:simple_content_access]) : true
creator = ::Katello::OrganizationCreator.new(@organization, sca: sca)
creator.create!
@organization.reload
Expand Down
2 changes: 1 addition & 1 deletion app/lib/katello/resources/candlepin/owner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def all

# Set the contentPrefix at creation time so that the client will get
# content only for the org it has been subscribed to
def create(key, description, content_access_mode: 'entitlement')
def create(key, description, content_access_mode: 'org_environment')
attrs = {
:key => key,
:displayName => description,
Expand Down
2 changes: 1 addition & 1 deletion app/services/katello/organization_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.create_all_organizations!
end
end

def initialize(organization, sca: false)
def initialize(organization, sca: true)
@organization = organization
@content_access_mode = sca ? 'org_environment' : 'entitlement'
end
Expand Down
4 changes: 4 additions & 0 deletions app/views/overrides/organizations/_edit_override.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
tag1 + tag2
end %>

<div class="alert alert-warning" role="alert">
<%= _('Simple Content Access will be required for all organizations in Katello 4.12.') %>
</div>

<% end %>
4 changes: 2 additions & 2 deletions app/views/overrides/organizations/_step_1_override.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<%= text_f f, :label, :class => 'input-xlarge' %>
<%= field(f, _('Simple Content Access')) do
tag1 = hidden_field_tag 'simple_content_access', '0'
tag2 = check_box_tag 'simple_content_access', '1', false
tag2 = check_box_tag 'simple_content_access', '1', true
tag1 + tag2
end %>

<% end %>
<% end %>
Loading

0 comments on commit e8f33c6

Please sign in to comment.