diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-03-26 13:34:14 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-04-26 20:59:57 +0100 |
commit | bbb28fd483031ca00230f0d68a10785b48137950 (patch) | |
tree | d527fbbec8b8ac0ea1e93d075ce090e8c8da7f93 /apps | |
parent | 4006d9961ed4a7df38657b88b287d1dc057c7851 (diff) | |
download | nextcloud-server-bbb28fd483031ca00230f0d68a10785b48137950.tar.gz nextcloud-server-bbb28fd483031ca00230f0d68a10785b48137950.zip |
fix(share): Send correct share attributes upon share creation
- Send correct share attributes (`share.attributes`) to server upon creation.
- Delete parts of code that create or reference, `share.hasDownloadPermission`
(Not required by Share API)
Resolves : https://github.com/nextcloud/server/issues/44131
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index faabe5ba33a..f3ad52eeb87 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -373,10 +373,14 @@ export default { */ canDownload: { get() { - return this.share.hasDownloadPermission + return this.share.attributes.find(attr => attr.key === 'download')?.enabled || false }, set(checked) { - this.updateAtomicPermissions({ isDownloadChecked: checked }) + // Find the 'download' attribute and update its value + const downloadAttr = this.share.attributes.find(attr => attr.key === 'download') + if (downloadAttr) { + downloadAttr.enabled = checked + } }, }, /** @@ -680,7 +684,6 @@ export default { isCreateChecked = this.canCreate, isDeleteChecked = this.canDelete, isReshareChecked = this.canReshare, - isDownloadChecked = this.canDownload, } = {}) { // calc permissions if checked const permissions = 0 @@ -690,9 +693,6 @@ export default { | (isEditChecked ? ATOMIC_PERMISSIONS.UPDATE : 0) | (isReshareChecked ? ATOMIC_PERMISSIONS.SHARE : 0) this.share.permissions = permissions - if (this.share.hasDownloadPermission !== isDownloadChecked) { - this.$set(this.share, 'hasDownloadPermission', isDownloadChecked) - } }, expandCustomPermissions() { if (!this.advancedSectionAccordionExpanded) { @@ -854,8 +854,8 @@ export default { shareType: share.shareType, shareWith: share.shareWith, permissions: share.permissions, - attributes: JSON.stringify(fileInfo.shareAttributes), expireDate: share.expireDate, + attributes: JSON.stringify(share.attributes), ...(share.note ? { note: share.note } : {}), ...(share.password ? { password: share.password } : {}), }) @@ -999,7 +999,7 @@ export default { flex-direction: column; } } - + /* Target component based style in NcCheckboxRadioSwitch slot content*/ :deep(span.checkbox-content__text.checkbox-radio-switch__text) { flex-wrap: wrap; |