From fbc8cfa7197c1dc06e85387da3f2a9ed033c2788 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Fri, 5 Jul 2024 15:47:41 +0100 Subject: [PATCH] fix(SharingDetailsView): Prevent illegal unselection of read permissions With the exception of "file drop" on link shares all other shares need the read permissions at least. Signed-off-by: fenn-cs --- apps/files_sharing/src/views/SharingDetailsTab.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index bac4ddda7d3b0..fa16d913d9709 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -150,7 +150,7 @@ {{ t('files_sharing', 'Custom permissions') }}
- {{ t('files_sharing', 'Read') }} @@ -534,6 +534,9 @@ export default { // allowed to revoke it too (but not to grant it again). return (this.fileInfo.canDownload() || this.canDownload) }, + canRemoveReadPermission() { + return this.allowsFileDrop && this.share.type === this.SHARE_TYPES.SHARE_TYPE_LINK + }, // if newPassword exists, but is empty, it means // the user deleted the original password hasUnsavedPassword() { @@ -736,6 +739,10 @@ export default { this.setCustomPermissions = true } } + // Read permission required for share creation + if (!this.canRemoveReadPermission) { + this.hasRead = true + } }, handleCustomPermissions() { if (!this.isNewShare && (this.hasCustomPermissions || this.share.setCustomPermissions)) {