From 656e109d2fe4aa8af3b68350cb1be342c4f4a5b8 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 8254e84b4a3f2..7f8ae7d17d853 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -180,7 +180,7 @@ {{ t('files_sharing', 'Custom permissions') }}
- {{ t('files_sharing', 'Read') }} @@ -602,6 +602,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() { @@ -822,6 +825,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)) {