diff options
author | Louis <louis@chmn.me> | 2024-07-03 10:03:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 10:03:56 +0200 |
commit | acb95d5c0f5d0f3d5ea4a88b4adf1be62f52c29a (patch) | |
tree | 458a55302a5ca708c3199ca7be349bf7efef7f2b /apps | |
parent | 829d7a90bda421012abb3b194fe45c9be81782e4 (diff) | |
parent | d1b5657b7f2bce2fc82a8088680a760b621585a1 (diff) | |
download | nextcloud-server-acb95d5c0f5d0f3d5ea4a88b4adf1be62f52c29a.tar.gz nextcloud-server-acb95d5c0f5d0f3d5ea4a88b4adf1be62f52c29a.zip |
Merge pull request #45982 from nextcloud/artonge/update/disable_copy_button_on_readonly_folders
fix(files): Disable buttons in copy/move dialog for non writable folders
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/actions/moveOrCopyAction.ts | 3 |
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, |