Skip to content

Commit

Permalink
Merge pull request #46321 from nextcloud/fix/46195/feedback-no-read-p…
Browse files Browse the repository at this point in the history
…erms

fix(SharingDetailsView): Prevent illegal unselection of read permissions
  • Loading branch information
Fenn-CS authored Jul 8, 2024
2 parents 9b2d195 + 5bb36dc commit 7b60b98
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 8 deletions.
9 changes: 8 additions & 1 deletion apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)) {
Expand Down
1 change: 0 additions & 1 deletion dist/1200-1200.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/1200-1200.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/1200-1200.js → dist/7885-7885.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/7885-7885.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/7885-7885.js.map.license
4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 7b60b98

Please sign in to comment.