Allow unpublishing of historic content in HistoricContentConcern [WHIT-3402]#11479
Open
davidsauntson wants to merge 1 commit into
Open
Allow unpublishing of historic content in HistoricContentConcern [WHIT-3402]#11479davidsauntson wants to merge 1 commit into
HistoricContentConcern [WHIT-3402]#11479davidsauntson wants to merge 1 commit into
Conversation
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
HistoricContentConcernHistoricContentConcern [WHIT-3402]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
HistoricContentConcernpreviously prevented any user without permission toupdatea historical edition from doing anything to it at all, since thebefore_actionwas 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
before_actionrestriction that checks the user can unpublish (rather than update) historical contentThis 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.