From d1317e75409bdb2f37129ce07aee621bbe2b1a6c Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Aug 2022 11:09:18 +0200 Subject: Remove copy in file actions when not allowed Signed-off-by: Vincent Petry --- apps/files_sharing/src/share.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/src/share.js b/apps/files_sharing/src/share.js index 76c007b5218..93891cbf287 100644 --- a/apps/files_sharing/src/share.js +++ b/apps/files_sharing/src/share.js @@ -94,6 +94,10 @@ import { getCapabilities } from '@nextcloud/capabilities' } if (_.isFunction(fileData.canDownload) && !fileData.canDownload()) { delete fileActions.actions.all.Download + if (fileData.permissions & OC.PERMISSION_UPDATE === 0) { + // neither move nor copy is allowed, remove the action completely + delete fileActions.actions.all.MoveCopy + } } tr.attr('data-share-permissions', sharePermissions) tr.attr('data-share-attributes', JSON.stringify(fileData.shareAttributes)) -- cgit v1.2.3