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

Remove content from public facing Examine indexes when it is made protected #14415

Merged
merged 4 commits into from Jun 23, 2023

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Jun 20, 2023

Prerequisites

  • I have added steps to test this contribution in the description below

Description

The public facing Examine indexes (i.e. ExternalIndex) filters out protected content when indexing on publish and when rebuilding (it happens here). However, if content is made protected subsequently to a publish or index rebuild, the content remains in the indexes.

This PR ensures that content is removed from the applicable indexes when public access protection is applied.

Limitations

We have to leverage the public access cache refreshing notification to implement this, because we need to perform this task on every single server in a load balanced setup. Unfortunately, these notifications have been implemented rather sparsely, which limits what we can do with them.

At this time we can only remove content from the indexes when public access is added to content. We can't add content to the indexes when public access is removed from content.

To overcome this limitations, editors must republish the entire structure of the previously protected content after removing public access restrictions.

Testing this PR

You should probably start by rebuilding the ExternalIndex, to ensure you've got an accurate starting point.

You also need a member group (members optional) to perform public access configuration.

  1. Create a structure of published content (i.e. a parent and a child)
  2. Verify that the ExternalIndex contains all the content.
  3. Apply public access restrictions at the top level of the structure.
  4. Verify that the ExternalIndex no longer contains any item in the structure.
  5. Remove the public access restrictions again.
  6. Republish the entire structure (publish with descendants at top level).
  7. Verify that the ExternalIndex once more contains all the content.

Copy link
Member

@Zeegaan Zeegaan left a comment

Choose a reason for hiding this comment

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

Looks good, tests good! 💪
I'll merge once the merge-conflict is resolved 😁

# Conflicts:
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
@kjac
Copy link
Contributor Author

kjac commented Jun 23, 2023

@Zeegaan conflicts are resolved 👍

@Zeegaan
Copy link
Member

Zeegaan commented Jun 23, 2023

Great, merging! 🚀

@Zeegaan Zeegaan merged commit e92ea34 into release/12.0 Jun 23, 2023
13 checks passed
@Zeegaan Zeegaan deleted the v12/fix/examine-protected-content branch June 23, 2023 10:00
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.

None yet

2 participants