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

SHS-5907: Implementation: Editors can easily set "view" access for Private Pages #1679

Open
wants to merge 3 commits into
base: 11.5.1-release
Choose a base branch
from

Conversation

codechefmarc
Copy link
Collaborator

@codechefmarc codechefmarc commented Nov 5, 2024

READY FOR REVIEW

Summary

  • For testing only! Adds a new potential contrib module content_access_simple that adds a simpler interface for settings view permissions per node.
  • Do not merge - once approved, this module can be uploaded to Drupal.org as an official project and then officially included as part of suhumsci
  • Code is coming from: https://github.com/codechefmarc/content_access_simple
  • Note: Tugboat preview sites do not work for this currently because there are memory errors for MySQL when clearing cache which happens when saving the form. Therefore this can only be tested locally for the moment. SWS is aware of this issue.

Need Review By (Date)

2024-11-06

Urgency

low

Steps to Test

  1. Login to the site as an admin
  2. Create a Private Page
  3. Title it
  4. Verify there is a new area below all of the fields called "Access and Permissions"

Screenshot 2024-11-05 at 2 01 24 PM

  1. Open it up and verify that there is a list of roles under "Visibility" but there is not "Developer", "Anonymous", or "Authenticated".
  2. Choose a role, like "Site Manager" and enable view access
  3. Save the node
  4. Visit the "Access control" tab for this node
  5. Verify that under "View any hs_private_page content", the "Site Manager" is checked in addition to "Developer" and "Authenticated user" (which were the defaults originally but they are hidden as per config)
  6. Uncheck "Authenticated user" under view any here, and save
  7. Attempt to view the page on a logged in user who is not "Site Manager" role and verify that you cannot access it
  8. Attempt to view the page on a logged in user who is "Site Manager" and verify that you can access it
  9. Edit the node and verify that under "Access and Permissions" you get a "complex" warning and no roles are listed

Screenshot 2024-11-05 at 1 59 39 PM

  1. To fix, visit the content type permissions at /admin/structure/types/manage/hs_private_page/access and also uncheck "Authenticated user" and save
  2. Edit the node again and this time, and this time, mark the node as unpublished and save
  3. Edit the node and verify that under "Access and Permissions" you get a "unpublished" warning but the roles are still listed

Screenshot 2024-11-05 at 1 59 19 PM

  1. Visit /admin/structure/types/manage/hs_private_page/form-display and drag the "Content Access Simple" "field" to another place in the form and save
  2. Edit the node and verify that the Access and Permissions has moved.

PR Checklist

@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 18:50 Destroyed
@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 19:17 Destroyed
@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 19:35 Destroyed
@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 21:14 Destroyed
@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 21:25 Destroyed
@codechefmarc codechefmarc self-assigned this Nov 5, 2024
@ahughes3 ahughes3 temporarily deployed to Tugboat November 5, 2024 22:04 Destroyed
@codechefmarc codechefmarc marked this pull request as ready for review November 5, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants