diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-07-05 15:47:41 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-07-08 20:32:52 +0100 |
commit | 48339500fc7dbe759e5dd62a46c32d8bd713b72e (patch) | |
tree | 1da3b88fe9bf36b9ad8dcba9c88ad991586002e6 /apps | |
parent | 9b2d195cda834c5a7ff044aae23699de261836f6 (diff) | |
download | nextcloud-server-48339500fc7dbe759e5dd62a46c32d8bd713b72e.tar.gz nextcloud-server-48339500fc7dbe759e5dd62a46c32d8bd713b72e.zip |
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 <fenn25.fn@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index 8254e84b4a3..7f8ae7d17d8 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') }} </NcCheckboxRadioSwitch> <section v-if="setCustomPermissions" class="custom-permissions-group"> - <NcCheckboxRadioSwitch :disabled="!allowsFileDrop && share.type === SHARE_TYPES.SHARE_TYPE_LINK" + <NcCheckboxRadioSwitch :disabled="!canRemoveReadPermission" :checked.sync="hasRead" data-cy-files-sharing-share-permissions-checkbox="read"> {{ 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)) { |