diff options
author | Greta Doci <gretadoci@gmail.com> | 2019-11-19 18:07:57 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-12-19 18:12:11 +0300 |
commit | 57997fefa2da537381ed8bec1dce039d7a4b6438 (patch) | |
tree | cbe98a522d114d3b79ecfc72d4d4704eb9bc7100 /apps/files_sharing/src/components/SharingEntry.vue | |
parent | aa46fc26a46cc6b375ba732bcf3e0dc04a08a2f7 (diff) |
add create and delete checkbox for sharesidebar
Signed-off-by: Greta Doci <gretadoci@gmail.com>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntry.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 21747089753..ad36361b9c2 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -40,15 +40,31 @@ {{ t('files_sharing', 'Allow editing') }} </ActionCheckbox> + <!-- create permission --> + <ActionCheckbox + ref="canCreate" + :checked.sync="canCreate" + :value="permissionsCreate" + :disabled="saving"> + {{ t('files_sharing', 'Allow creating') }} + </ActionCheckbox> <!-- reshare permission --> <ActionCheckbox ref="canReshare" :checked.sync="canReshare" :value="permissionsShare" :disabled="saving"> - {{ t('files_sharing', 'Can reshare') }} + {{ t('files_sharing', 'Allow resharing') }} </ActionCheckbox> + <!-- delete permission --> + <ActionCheckbox + ref="canDelete" + :checked.sync="canDelete" + :value="permissionsDelete" + :disabled="saving"> + {{ t('files_sharing', 'Allow deleting') }} + </ActionCheckbox> <!-- expiration date --> <ActionCheckbox :checked.sync="hasExpirationDate" :disabled="config.isDefaultExpireDateEnforced || saving" @@ -142,6 +158,8 @@ export default { data() { return { permissionsEdit: OC.PERMISSION_UPDATE, + permissionsCreate: OC.PERMISSION_CREATE, + permissionsDelete: OC.PERMISSION_DELETE, permissionsRead: OC.PERMISSION_READ, permissionsShare: OC.PERMISSION_SHARE, } @@ -197,7 +215,31 @@ export default { return this.share.hasUpdatePermission }, set: function(checked) { - this.updatePermissions(checked, this.canReshare) + this.updatePermissions({ isEditChecked: checked }) + }, + }, + + /** + * Can the sharee create the shared file ? + */ + canCreate: { + get: function() { + return this.share.hasCreatePermission + }, + set: function(checked) { + this.updatePermissions({ isCreateChecked: checked }) + }, + }, + + /** + * Can the sharee delete the shared file ? + */ + canDelete: { + get: function() { + return this.share.hasDeletePermission + }, + set: function(checked) { + this.updatePermissions({ isDeleteChecked: checked }) }, }, @@ -209,7 +251,7 @@ export default { return this.share.hasSharePermission }, set: function(checked) { - this.updatePermissions(this.canEdit, checked) + this.updatePermissions({ isReshareChecked: checked }) }, }, @@ -238,9 +280,11 @@ export default { }, methods: { - updatePermissions(isEditChecked, isReshareChecked) { + updatePermissions({ isEditChecked = this.canEdit, isCreateChecked = this.canCreate, isDeleteChecked = this.canDelete, isReshareChecked = this.canReshare } = {}) { // calc permissions if checked const permissions = this.permissionsRead + | (isCreateChecked ? this.permissionsCreate : 0) + | (isDeleteChecked ? this.permissionsDelete : 0) | (isEditChecked ? this.permissionsEdit : 0) | (isReshareChecked ? this.permissionsShare : 0) @@ -248,7 +292,6 @@ export default { this.queueUpdate('permissions') }, }, - } </script> |