Skip to content

Selectively allow unpublishing of historical editions [WHIT-3402]#11456

Open
davidsauntson wants to merge 1 commit into
mainfrom
unpublishing-historical-docs-permission
Open

Selectively allow unpublishing of historical editions [WHIT-3402]#11456
davidsauntson wants to merge 1 commit into
mainfrom
unpublishing-historical-docs-permission

Conversation

@davidsauntson
Copy link
Copy Markdown
Contributor

Previously only GDS Editors and GDS Admins could unpublish historical content. The DBT are about to unpublish and archive a lot of content, so an exception has been made to allow specific users outside of those two GDS roles to unpublish historic content. See https://gov-uk.atlassian.net/browse/WHIT-3402

This change creates the relevant unpublishing permission and allows users with it to perform the unpublishing action for historic documents.


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

Previously only GDS Editors and GDS Admins could unpublish historical content.  The DBT are about to unpublish and archive a lot of content, so an exception has been made to allow specific users outside of those two GDS roles to unpublish historic content.

This change creates the relevant unpublishing permission and allows users with it to perform the unpublishing action for historic documents.
Comment thread test/factories/users.rb
end
end

factory :historical_unpublisher, parent: :user do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

historical_content_unpublisher maybe?

assert enforcer_for(@user, historic_edition).can?(:unpublish)
end

test "can't perform any other action on an historical document" do
Copy link
Copy Markdown
Contributor

@TonyGDS TonyGDS May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth also doing something similar for GDS Admin and GDS Editors, i.e. they can do anything:

test "can modify historic editions" do

test "can modify historic editions" do

Copy link
Copy Markdown
Contributor

@TonyGDS TonyGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants