Skip to content

Commit 58db30d

Browse files
committed
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 : #44131 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
1 parent 73da60d commit 58db30d

22 files changed

Lines changed: 36 additions & 124 deletions

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,14 @@ export default {
353353
*/
354354
canDownload: {
355355
get() {
356-
return this.share.hasDownloadPermission
356+
return this.share.attributes.find(attr => attr.key === 'download')?.enabled || false
357357
},
358358
set(checked) {
359-
this.updateAtomicPermissions({ isDownloadChecked: checked })
359+
// Find the 'download' attribute and update its value
360+
const downloadAttr = this.share.attributes.find(attr => attr.key === 'download')
361+
if (downloadAttr) {
362+
downloadAttr.enabled = checked
363+
}
360364
},
361365
},
362366
/**
@@ -654,7 +658,6 @@ export default {
654658
isCreateChecked = this.canCreate,
655659
isDeleteChecked = this.canDelete,
656660
isReshareChecked = this.canReshare,
657-
isDownloadChecked = this.canDownload,
658661
} = {}) {
659662
// calc permissions if checked
660663
const permissions = 0
@@ -664,9 +667,6 @@ export default {
664667
| (isEditChecked ? ATOMIC_PERMISSIONS.UPDATE : 0)
665668
| (isReshareChecked ? ATOMIC_PERMISSIONS.SHARE : 0)
666669
this.share.permissions = permissions
667-
if (this.share.hasDownloadPermission !== isDownloadChecked) {
668-
this.$set(this.share, 'hasDownloadPermission', isDownloadChecked)
669-
}
670670
},
671671
expandCustomPermissions() {
672672
if (!this.advancedSectionAccordionExpanded) {
@@ -826,8 +826,8 @@ export default {
826826
shareType: share.shareType,
827827
shareWith: share.shareWith,
828828
permissions: share.permissions,
829-
attributes: JSON.stringify(fileInfo.shareAttributes),
830829
expireDate: share.expireDate,
830+
attributes: JSON.stringify(share.attributes),
831831
...(share.note ? { note: share.note } : {}),
832832
...(share.password ? { password: share.password } : {}),
833833
})

core/css/server.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/css/server.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/comments-comments-app.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/comments-comments-app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/core-common.js.LICENSE.txt

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -927,94 +927,6 @@ object-assign
927927
*
928928
*/
929929

930-
/**
931-
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
932-
*
933-
* @author Ferdinand Thiessen <opensource@fthiessen.de>
934-
*
935-
* @license AGPL-3.0-or-later
936-
*
937-
* This program is free software: you can redistribute it and/or modify
938-
* it under the terms of the GNU Affero General Public License as
939-
* published by the Free Software Foundation, either version 3 of the
940-
* License, or (at your option) any later version.
941-
*
942-
* This program is distributed in the hope that it will be useful,
943-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
944-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
945-
* GNU Affero General Public License for more details.
946-
*
947-
* You should have received a copy of the GNU Affero General Public License
948-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
949-
*
950-
*/
951-
952-
/**
953-
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
954-
*
955-
* @author Ferdinand Thiessen <opensource@fthiessen.de>
956-
*
957-
* @license AGPL-3.0-or-later
958-
*
959-
* This program is free software: you can redistribute it and/or modify
960-
* it under the terms of the GNU Affero General Public License as
961-
* published by the Free Software Foundation, either version 3 of the
962-
* License, or (at your option) any later version.
963-
*
964-
* This program is distributed in the hope that it will be useful,
965-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
966-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
967-
* GNU Affero General Public License for more details.
968-
*
969-
* You should have received a copy of the GNU Affero General Public License
970-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
971-
*/
972-
973-
/**
974-
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
975-
*
976-
* @author Ferdinand Thiessen <opensource@fthiessen.de>
977-
*
978-
* @license AGPL-3.0-or-later
979-
*
980-
* This program is free software: you can redistribute it and/or modify
981-
* it under the terms of the GNU Affero General Public License as
982-
* published by the Free Software Foundation, either version 3 of the
983-
* License, or (at your option) any later version.
984-
*
985-
* This program is distributed in the hope that it will be useful,
986-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
987-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
988-
* GNU Affero General Public License for more details.
989-
*
990-
* You should have received a copy of the GNU Affero General Public License
991-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
992-
*
993-
*/
994-
995-
/**
996-
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
997-
*
998-
* @author Ferdinand Thiessen <opensource@fthiessen.de>
999-
* @author John Molakvoæ <skjnldsv@protonmail.com>
1000-
*
1001-
* @license AGPL-3.0-or-later
1002-
*
1003-
* This program is free software: you can redistribute it and/or modify
1004-
* it under the terms of the GNU Affero General Public License as
1005-
* published by the Free Software Foundation, either version 3 of the
1006-
* License, or (at your option) any later version.
1007-
*
1008-
* This program is distributed in the hope that it will be useful,
1009-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1011-
* GNU Affero General Public License for more details.
1012-
*
1013-
* You should have received a copy of the GNU Affero General Public License
1014-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1015-
*
1016-
*/
1017-
1018930
/**
1019931
* @license
1020932
* Lodash <https://lodash.com/>

dist/core-common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/federatedfilesharing-vue-settings-admin.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/federatedfilesharing-vue-settings-admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)