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 <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jan 15, 2025
1 parent 7689588 commit b06a876
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
@@ -258,6 +258,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'),

0 comments on commit b06a876

Please sign in to comment.