fix: disable rename action in password-protected folder view
Description
Disables the Rename action in the breadcrumb context menu when viewing a password-protected folder (public link context).
Related Issue
Fixes #12365
Motivation and Context
When renaming a folder from inside a password-protected folder view, the action operates in the public link context. This causes the rename to create a duplicate folder instead of renaming the original.
The fix aligns with:
- The existing pattern in
useFileActionsDelete.tswhich already disables delete in public links - The README documentation stating "Moving or renaming a link file is prevented by the webUI"
How Has This Been Tested?
- [x] Unit tests pass (17 tests)
- [x] Manual: Verified rename option is hidden inside PPF view
- [x] Manual: Verified rename still works in normal folder views
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
@LukasHirt PTAL, could you please review this and confirm whether this approach looks correct?
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
50.0% Coverage on New Code
0.0% Duplication on New Code
Hey! The doc reference is in packages/web-app-password-protected-folders/README.md on line 59:
"Moving or renaming a link file is prevented by the webUI..."
Though I realize it refers to the link file itself, not actions inside the modal.
The main reason for this fix: renaming from inside the PPF modal (public link iframe) operates on the wrong context, causing the folder to fork instead of rename. Hiding it follows the same pattern as useFileActionsDelete (line 50) which already disables delete in public links.
Let me know if you'd prefer a different approach!
Alternative fix (more complex): Instead of hiding, we could intercept the rename action and make it update both:
- The destination folder path
- The
.pseclink file content But this would require backend changes too.
The main problem is with the shared context for PPF and public links in general. Since PPF "abuses" the public link functionality, simply preventing renaming breaks the regular links.
Regarding backend changes, as of now, this is only frontend feature. This was done on purpose to leave backend out of this topic. If it would need to be touched, it would probably be better to do a real PPF implementation on the backend.