Repository navigation
fix(folders): require EDIT on the source folder when moving it - #38113
Merged
Merged
Conversation
FolderAPI.move(Folder, Folder, ...) and FolderAPI.move(Folder, Host, ...) now require EDIT permission on the folder being moved, in addition to READ on it and CAN_ADD_CHILDREN on the destination. This matches the String-id overload, folder rename and folder delete. A move refused for missing EDIT on the folder logs a WARN line naming the user and folder, and every refused move throws DotSecurityException.
Contributor
|
Claude finished @swicken's task in 1m 9s —— View job Code ReviewI reviewed the diff against the three changed files ( Checklist
New IssuesNo issues found. NotesThe change is correct and consistent with the rest of
Minor, non-blocking observation (not worth changing on its own): the WARN line is logged only on the EDIT failure in LGTM. |
adrianjm-dotCMS
approved these changes
Oct 20, 2026
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
FolderAPI.move(Folder, Folder, User, boolean)andFolderAPI.move(Folder, Host, User, boolean)now require EDIT permission on the folder being moved, in addition to READ on it and CAN_ADD_CHILDREN on the destination. This matchesmove(String, String, ...)(used by the Site Browser),renameFolderanddelete, which already require EDIT/WRITE.DotSecurityException.Checklist
Additional Info
Compatibility: a user with READ but not EDIT on a folder can no longer move it through the legacy folder action, WebDAV, or a plugin calling these methods as that user. The Site Browser move is unchanged because it already required WRITE. Administrators and the system user (push publishing) are unaffected. There is no schema, index or API signature change, and no configuration switch.
Tests: four cases in
FolderAPITest(already inMainSuite1a) move a folder into another folder and to a site root, once with READ only on the source (expectsDotSecurityExceptionand no change) and once with READ and EDIT (expects the move).FolderAPITest: 107 run, 0 failures.Fixes dotCMS/private-issues#882