fix: update rename permissions check in files ui

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-01-06 17:36:57 +01:00 committed by Andy Scherzinger
parent 822a09c79c
commit 4ab0e8cdd5
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -37,10 +37,15 @@ export const action: IFileAction = {
: filesStore.getNode(dirname(node.source))
const parentPermissions = parentNode?.permissions || Permission.NONE
// Only enable if the node have the delete permission
// and if the parent folder allows creating files
return Boolean(node.permissions & Permission.DELETE)
&& Boolean(parentPermissions & Permission.CREATE)
// Enable if the node has update permissions or the node
// has delete permission and the parent folder allows creating files
return (
(
Boolean(node.permissions & Permission.DELETE)
&& Boolean(parentPermissions & Permission.CREATE)
)
|| Boolean(node.permissions & Permission.UPDATE)
)
},
async exec({ nodes }) {