mirror of
https://github.com/nextcloud/server.git
synced 2026-05-21 01:25:29 -04:00
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>
This commit is contained in:
parent
90d712f1ff
commit
fbc8cfa719
1 changed files with 8 additions and 1 deletions
|
|
@ -150,7 +150,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">
|
||||
{{ t('files_sharing', 'Read') }}
|
||||
</NcCheckboxRadioSwitch>
|
||||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue