From e2501f05958d8de0c0da9d676bfabcb25cc67341 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 6fac3e4bb8f03..b3e9f7f49c5fa 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -176,7 +176,7 @@ {{ t('files_sharing', 'Custom permissions') }}
- {{ t('files_sharing', 'Read') }} @@ -596,6 +596,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() { @@ -816,6 +819,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)) {