Skip to content

Commit

Permalink
fix(files): hide move dialog action if destination has no CREATE perm…
Browse files Browse the repository at this point in the history
…ission

Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Jan 17, 2025
1 parent 9d8035f commit 8ba3c9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/files/src/actions/moveOrCopyAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ async function openFilePickerForAction(
return buttons
}

if (selection.some((node) => (node.permissions & Permission.CREATE) === 0)) {
// Missing 'CREATE' permissions for selected destination
return buttons
}

if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) {
buttons.push({
label: target ? t('files', 'Move to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Move'),
Expand Down

0 comments on commit 8ba3c9b

Please sign in to comment.