aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-06-13 16:09:56 +0200
committerLouis Chemineau <louis@chmn.me>2024-07-02 17:50:19 +0200
commitd1b5657b7f2bce2fc82a8088680a760b621585a1 (patch)
treee83bd365891598a4ed64a72e7708c08c3c7fbc79 /apps/files/src
parent9972589cad6de5b81ecdfc7f90ad79a2f09a81f9 (diff)
downloadnextcloud-server-d1b5657b7f2bce2fc82a8088680a760b621585a1.tar.gz
nextcloud-server-d1b5657b7f2bce2fc82a8088680a760b621585a1.zip
fix(files): Disable buttons in copy/move dialog for non writable folders
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/actions/moveOrCopyAction.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files/src/actions/moveOrCopyAction.ts b/apps/files/src/actions/moveOrCopyAction.ts
index 623170d3be6..5d3a7afa0e2 100644
--- a/apps/files/src/actions/moveOrCopyAction.ts
+++ b/apps/files/src/actions/moveOrCopyAction.ts
@@ -10,7 +10,7 @@ import type { MoveCopyResult } from './moveOrCopyActionUtils'
import { isAxiosError } from '@nextcloud/axios'
import { FilePickerClosed, getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
-import { FileAction, FileType, NodeStatus, davGetClient, davRootPath, davResultToNode, davGetDefaultPropfind, getUniqueName } from '@nextcloud/files'
+import { FileAction, FileType, NodeStatus, davGetClient, davRootPath, davResultToNode, davGetDefaultPropfind, getUniqueName, Permission } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import { openConflictPicker, hasConflict } from '@nextcloud/upload'
import { basename, join } from 'path'
@@ -200,6 +200,7 @@ const openFilePickerForAction = async (action: MoveCopyAction, dir = '/', nodes:
label: target ? t('files', 'Copy to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Copy'),
type: 'primary',
icon: CopyIconSvg,
+ disabled: selection.some((node) => (node.permissions & Permission.CREATE) === 0),
async callback(destination: Node[]) {
resolve({
destination: destination[0] as Folder,