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

Ensure Folders Cannot Be Deleted If They Contain Content (Including Inaccessible Content) #4191

Merged
merged 11 commits into from
Aug 8, 2024

Conversation

adrians5j
Copy link
Member

@adrians5j adrians5j commented Jul 2, 2024

Changes

This PR includes two improvements related to checking if a folder can be deleted.

Most importantly, upon deleting a folder, we now take into consideration the possibility that a folder might contain folders or content (e.g. files or CMS entries) to which the user does not have access. Because this was previously not the case, deletion of a folder would succeed in case it contained folders or content to which the user does not have access.

Also, prior to this PR, deletion of a CMS entries folder would not succeed if a folder had CMS entries (which is the correct behaviour), but it would incorrectly succeed if a folder had child folders. Deletion of a folder should be prevented in case a folder contains at least one content entry or one folder.

Additional Changes

Refactored the existing code (three lifecycle hooks that perform these checks), and also tests a bit.

How Has This Been Tested?

Added Jest tests.

Documentation

Changelog.

@adrians5j adrians5j added this to the 5.40.2 milestone Jul 2, 2024
@adrians5j adrians5j changed the base branch from next to dev July 2, 2024 13:51
@adrians5j adrians5j modified the milestones: 5.40.2, 5.40.3 Jul 12, 2024
@adrians5j adrians5j modified the milestones: 5.40.3, 5.40.5 Aug 7, 2024
@adrians5j adrians5j merged commit 1d3b0e7 into dev Aug 8, 2024
92 checks passed
@adrians5j adrians5j deleted the adrian/flp-deletion-issue branch August 22, 2024 11:40
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.

2 participants