aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/views/SharingDetailsTab.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/views/SharingDetailsTab.vue')
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue34
1 files changed, 22 insertions, 12 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 8893ee984a3..ef7f4964a84 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -16,8 +16,7 @@
</span>
</div>
<div class="sharingTabDetailsView__wrapper">
- <div ref="quickPermissions"
- class="sharingTabDetailsView__quick-permissions">
+ <div ref="quickPermissions" class="sharingTabDetailsView__quick-permissions">
<div>
<NcCheckboxRadioSwitch :button-variant="true"
:checked.sync="sharingPermission"
@@ -743,7 +742,7 @@ export default {
}
},
- initializePermissions() {
+ handleShareType() {
if (this.share.share_type) {
this.share.type = this.share.share_type
}
@@ -752,23 +751,34 @@ export default {
if ('shareType' in this.share) {
this.share.type = this.share.shareType
}
+ },
+ handleDefaultPermissions() {
if (this.isNewShare) {
- if (this.isPublicShare) {
- this.sharingPermission = BUNDLED_PERMISSIONS.READ_ONLY.toString()
+ const defaultPermissions = this.config.defaultPermissions
+ if (defaultPermissions === BUNDLED_PERMISSIONS.READ_ONLY || defaultPermissions === BUNDLED_PERMISSIONS.ALL) {
+ this.sharingPermission = defaultPermissions.toString()
} else {
- this.sharingPermission = BUNDLED_PERMISSIONS.ALL.toString()
- }
-
- } else {
- if (this.hasCustomPermissions || this.share.setCustomPermissions) {
this.sharingPermission = 'custom'
+ this.share.permissions = defaultPermissions
this.advancedSectionAccordionExpanded = true
this.setCustomPermissions = true
- } else {
- this.sharingPermission = this.share.permissions.toString()
}
}
},
+ handleCustomPermissions() {
+ if (!this.isNewShare && (this.hasCustomPermissions || this.share.setCustomPermissions)) {
+ this.sharingPermission = 'custom'
+ this.advancedSectionAccordionExpanded = true
+ this.setCustomPermissions = true
+ } else {
+ this.sharingPermission = this.share.permissions.toString()
+ }
+ },
+ initializePermissions() {
+ this.handleShareType()
+ this.handleDefaultPermissions()
+ this.handleCustomPermissions()
+ },
async saveShare() {
const permissionsAndAttributes = ['permissions', 'attributes', 'note', 'expireDate']
const publicShareAttributes = ['label', 'password', 'hideDownload']