diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2023-09-15 11:59:03 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2023-09-15 12:14:38 +0100 |
commit | 386b08d139f73b0e6cb48540a54aa71a3dde2a18 (patch) | |
tree | 4d2fa85cf78af8672b5d7b57b9214d1a97f38e31 /apps | |
parent | bf46c5b73fa4276f3345971389db54e987df3eb7 (diff) | |
download | nextcloud-server-386b08d139f73b0e6cb48540a54aa71a3dde2a18.tar.gz nextcloud-server-386b08d139f73b0e6cb48540a54aa71a3dde2a18.zip |
Correctly switch/revert from custom to bundled perms
We have a set custom permissions checkbox, that when selected should set
the quick permissions settings to custom as well as show the custom permission settings.
When the checkbox is unchecked the quick permissions have to be reset to the default,
`bundledPermissions.ALL` but also users can switch from custom permissions to `bundled`
by just changing the radio select, hence we need a mechanism to set the permissions back
to the correct fallback depending on where the user has toggled the the custom permission from.
The mechanism is `revertSharingPermission` and this commit, makes sure revert values are correctly
set upon toggle.
Resolves : https://github.com/nextcloud/server/issues/40431
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index ea6ed5512c5..7c68e50b1c1 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -263,7 +263,7 @@ export default { return { writeNoteToRecipientIsChecked: false, sharingPermission: BUNDLED_PERMISSIONS.ALL.toString(), - revertSharingPermission: null, + revertSharingPermission: BUNDLED_PERMISSIONS.ALL.toString(), setCustomPermissions: false, passwordError: false, advancedSectionAccordionExpanded: false, @@ -675,8 +675,10 @@ export default { } this.toggleCustomPermissions() }, - toggleCustomPermissions() { - this.setCustomPermissions = this.sharingPermission === 'custom' + toggleCustomPermissions(selectedPermission) { + const isCustomPermissions = this.sharingPermission === 'custom' + this.revertSharingPermission = !isCustomPermissions ? selectedPermission : 'custom' + this.setCustomPermissions = isCustomPermissions }, initializeAttributes() { |