The Wayback Machine - https://web.archive.org/web/20201125075233/https://github.com/wagtail/wagtail/issues/6212
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privacy settings aren't copied on page copy #6212

Open
jessemenn opened this issue Jul 7, 2020 · 2 comments
Open

Privacy settings aren't copied on page copy #6212

jessemenn opened this issue Jul 7, 2020 · 2 comments

Comments

@jessemenn
Copy link
Contributor

@jessemenn jessemenn commented Jul 7, 2020

Issue Summary

Copying a page doesn't copy the original's privacy settings, but appears to inherit from the new parent's privacy settings.

That is, if page A1 is public, and its child page A1a has privacy set to "private, accessible to...," copying page A1a to A1b causes A1b to be set to public. I feel there's a general expectation that the original's privacy settings would copy over to the newly created page.

Steps to Reproduce

  1. Set a page's privacy setting to public and a child page to private.
  2. Copy private page.
  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes

Technical details

  • Python version: 3.7.3, 3.8.2
  • Django version: 3.0.8, 2.2.10
  • Wagtail version: 2.9.2
  • Browser version: Chrome, Firefox, Safari.
@jessemenn jessemenn added the type:Bug label Jul 7, 2020
@zerolab
Copy link
Contributor

@zerolab zerolab commented Jul 8, 2020

The reason the privacy settings are not copied is that the copy mechanism deals with fields on the Page model. When one changes the privacy settings from public to anything else, a PageViewRestriction model instance is created.

To get this working, we should consider the following scenarios:

  • The privacy settings are on the page being copied. On copy:
    • New parent has privacy settings. Do nothing
    • New parent has no privacy settings. Copy the settings (that is, create a new PageViewRestriction with the page foreign key set to the newly created page)
  • The privacy settings are on the page parent. On copy: do nothing. If the new parent has privacy settings, they will be inherited.

Last, but not least, document the above.

@Skchoudhary
Copy link

@Skchoudhary Skchoudhary commented Sep 18, 2020

Hello @zerolab , I would like to pick up this issue.

Skchoudhary pushed a commit to Skchoudhary/wagtail that referenced this issue Sep 23, 2020
Skchoudhary pushed a commit to Skchoudhary/wagtail that referenced this issue Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.