Merge pull request #46321 from nextcloud/fix/46195/feedback-no-read-perms

fix(SharingDetailsView): Prevent illegal unselection of read permissions
pull/46320/head
F. E Noel Nfebe 2024-07-08 21:02:26 +07:00 committed by GitHub
commit 7b60b989b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 15 additions and 8 deletions

@ -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)) {

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
1200-1200.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
7885-7885.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long