Skip to content

CMS-859 Disable page privacy settings for CMS users#568

Merged
sanjeevz3009 merged 9 commits intomainfrom
CMS-859-disable-page-privacy
Apr 14, 2026
Merged

CMS-859 Disable page privacy settings for CMS users#568
sanjeevz3009 merged 9 commits intomainfrom
CMS-859-disable-page-privacy

Conversation

@AdamHawtin
Copy link
Copy Markdown
Contributor

@AdamHawtin AdamHawtin commented Apr 8, 2026

What is the context of this PR?

We need to disable Wagtail's page privacy features. This PR achieves this by overriding the can_set_view_restrictions permission test in the BasePagePermissionTester to always return false, preventing any CMS admin UI user from setting view restrictions for pages.

It also includes a migration to remove any existing page view restrictions as we are not supporting them and CMS users will no longer be able to remove them themselves after this change.

How to review

Run this branch, then try accessing the page privacy settings for any page in the Wagtail admin UI, as an admin, publishing admin and publishing officer. You should not be presented with the options to change page privacy settings.

Deployment Safety

Bleed and Sandbox deploy automatically on merge, so PRs should be safe to deploy immediately.

Please select one:

  • Safe to auto-deploy
  • Not safe to auto-deploy

Follow-up Actions

List any follow-up actions (if applicable), like needed documentation updates or additional testing.

@AdamHawtin AdamHawtin added the Enhancement Enhance the functionality of existing features. label Apr 8, 2026
@AdamHawtin AdamHawtin changed the title Disable page privacy settings for CMS users CMS-859 Disable page privacy settings for CMS users Apr 9, 2026
@AdamHawtin AdamHawtin marked this pull request as ready for review April 9, 2026 07:43
@AdamHawtin AdamHawtin requested a review from a team as a code owner April 9, 2026 07:43
Copy link
Copy Markdown
Contributor

@AWitcherONS AWitcherONS left a comment

Choose a reason for hiding this comment

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

Unit tests pass
page privacy not seen

Comment thread cms/core/permission_testers.py Outdated
Co-authored-by: Sanjeev Srithevan <41544303+sanjeevz3009@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@MaciekBaron MaciekBaron left a comment

Choose a reason for hiding this comment

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

LGTM

Question: Should we consider adding a migration removing any existing restrictions, for cleanup purposes?

@sanjeevz3009
Copy link
Copy Markdown
Contributor

sanjeevz3009 commented Apr 9, 2026

LGTM

Question: Should we consider adding a migration removing any existing restrictions, for cleanup purposes?

@MaciekBaron @AdamHawtin It's mentioned in the JIRA card:

We may need to consider doing a mop up of any pages that
have been made private in exisitng environments, since users
would not be able to make them public again after this change.

Maybe it needs a separate card as a follow-up? If so good to have a card created and chucked into the backlog.

Copy link
Copy Markdown
Contributor

@sanjeevz3009 sanjeevz3009 left a comment

Choose a reason for hiding this comment

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

Tested it against all page types. Works well. LGTM!

@AdamHawtin
Copy link
Copy Markdown
Contributor Author

AdamHawtin commented Apr 9, 2026

LGTM

Question: Should we consider adding a migration removing any existing restrictions, for cleanup purposes?

Good point, I've added a migration in d1da0aa.

Comment thread cms/core/migrations/0015_delete_existing_page_view_restrictions.py Outdated
Copy link
Copy Markdown
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

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

Other than Sanjeev's comment. 👍

Comment thread cms/core/permission_testers.py
AdamHawtin and others added 2 commits April 10, 2026 10:40
Comment thread cms/core/permission_testers.py Outdated
@MaciekBaron MaciekBaron removed the request for review from AWitcherONS April 14, 2026 09:39
Copy link
Copy Markdown
Contributor

@sanjeevz3009 sanjeevz3009 left a comment

Choose a reason for hiding this comment

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

LGTM!

@sanjeevz3009 sanjeevz3009 merged commit 5e85e61 into main Apr 14, 2026
29 of 30 checks passed
@sanjeevz3009 sanjeevz3009 deleted the CMS-859-disable-page-privacy branch April 14, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhance the functionality of existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants