Skip to content

Commit

Permalink
Change default to true for restrict_access_by_org feature
Browse files Browse the repository at this point in the history
This is not restrict access to Mainstream content for departments outsdie of GDS
  • Loading branch information
baisa committed Jan 14, 2025
1 parent 00b2fe8 commit 8a6b5c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion config/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
description: "Update the publications edit page to use the GOV.UK Design System"

feature :restrict_access_by_org,
default: false,
default: true,
description: "Restrict access to editions based on the user's org and which org(s) own the edition"

feature :show_link_to_content_block_manager,
Expand Down
22 changes: 11 additions & 11 deletions test/functional/editions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class EditionsControllerTest < ActionController::TestCase
setup do
login_as_stub_user
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
test_strategy.switch!(:restrict_access_by_org, true)
@edition = FactoryBot.create(:edition, :fact_check)
@welsh_edition = FactoryBot.create(:edition, :fact_check, :welsh)
end
Expand Down Expand Up @@ -46,6 +46,16 @@ class EditionsControllerTest < ActionController::TestCase
end

context "when 'restrict_access_by_org' feature toggle is disabled" do
setup do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
end

teardown do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, true)
end

%i[show metadata history admin linking unpublish].each do |action|
context "##{action}" do
setup do
Expand All @@ -64,16 +74,6 @@ class EditionsControllerTest < ActionController::TestCase
end

context "when 'restrict_access_by_org' feature toggle is enabled" do
setup do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, true)
end

teardown do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
end

%i[show metadata history admin linking unpublish].each do |action|
context "##{action}" do
setup do
Expand Down
22 changes: 11 additions & 11 deletions test/functional/legacy_editions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class LegacyEditionsControllerTest < ActionController::TestCase
stub_holidays_used_by_fact_check

test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
test_strategy.switch!(:restrict_access_by_org, true)
end

context "#create" do
Expand Down Expand Up @@ -1309,6 +1309,16 @@ class LegacyEditionsControllerTest < ActionController::TestCase
end

context "when 'restrict_access_by_org' feature toggle is disabled" do
setup do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
end

teardown do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, true)
end

%i[metadata history].each do |action|
context "##{action}" do
setup do
Expand All @@ -1327,16 +1337,6 @@ class LegacyEditionsControllerTest < ActionController::TestCase
end

context "when 'restrict_access_by_org' feature toggle is enabled" do
setup do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, true)
end

teardown do
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:restrict_access_by_org, false)
end

%i[show metadata history admin unpublish duplicate update linking update_tagging update_related_external_links review destroy progress diff process_unpublish diagram].each do |action|
context "##{action}" do
setup do
Expand Down

0 comments on commit 8a6b5c1

Please sign in to comment.