|
|
|
@ -353,10 +353,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
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
@ -654,7 +658,6 @@ export default {
|
|
|
|
|
isCreateChecked = this.canCreate,
|
|
|
|
|
isDeleteChecked = this.canDelete,
|
|
|
|
|
isReshareChecked = this.canReshare,
|
|
|
|
|
isDownloadChecked = this.canDownload,
|
|
|
|
|
} = {}) {
|
|
|
|
|
// calc permissions if checked
|
|
|
|
|
const permissions = 0
|
|
|
|
@ -664,9 +667,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) {
|
|
|
|
@ -826,8 +826,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 } : {}),
|
|
|
|
|
})
|
|
|
|
|