Skip to content

Allow unpublishing of historic content in HistoricContentConcern [WHIT-3402]#11479

Open
davidsauntson wants to merge 1 commit into
mainfrom
unpublishing-historic-content
Open

Allow unpublishing of historic content in HistoricContentConcern [WHIT-3402]#11479
davidsauntson wants to merge 1 commit into
mainfrom
unpublishing-historic-content

Conversation

@davidsauntson
Copy link
Copy Markdown
Contributor

The HistoricContentConcern previously prevented any user without permission to update a historical edition from doing anything to it at all, since the before_action was called for every action.

This was correct (and mostly still is), but now we want some users to be able to unpublish historical content but not otherwise edit it.

This change (along with #11456) allows that by

  • creating a new before_action restriction that checks the user can unpublish (rather than update) historical content
  • applies the new restriction only for the unpublish and confirmation routes
  • applies the existing editing restriction to the other, non-unpublishing related routes

⚠️ 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.

The `HistoricContentConcern` previously prevented any user without permission to `update` a historical edition from doing anything to it at all, since the `before_action` was called for every action.

Now we want some users to be able to unpublish historical content but not otherwise edit it.

This change (along with commit 4f9a723) allows that by
- creating a new `before_action` restriction that checks the user can unpublish (rather than update)
- applies the new restriction only for the unpublish and confirmation routes
- applies the existing editing restriction to the other, non-unpublishing related routes
@davidsauntson davidsauntson changed the title Allow unpublishing of historic content in HistoricContentConcern Allow unpublishing of historic content in HistoricContentConcern [WHIT-3402] May 21, 2026
Copy link
Copy Markdown
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

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

Great work ⭐

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