From 806bb2acf6dd4e525a939b7d6a377787d694abb3 Mon Sep 17 00:00:00 2001
From: Yogesh Shejwadkar
Date: Wed, 25 Aug 2021 07:54:16 +0530
Subject: [PATCH 1/4] NMC-430 harmonizing of sharing permissions step #1
---
.../src/components/SharingEntry.vue | 134 ++++++++++++++----
.../src/components/SharingEntryLink.vue | 24 +++-
2 files changed, 124 insertions(+), 34 deletions(-)
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index 8167172ceeae3..ed9f3b6891428 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -44,34 +44,73 @@
class="sharing-entry__actions"
@close="onMenuClose">
-
-
- {{ t('files_sharing', 'Allow editing') }}
-
-
-
-
- {{ t('files_sharing', 'Allow creating') }}
-
+
+
+
+
+
+ {{ t('files_sharing', 'Allow editing') }}
+
+
+
+
+ {{ t('files_sharing', 'Allow creating') }}
+
+
+
+
+ {{ t('files_sharing', 'Allow deleting') }}
+
+
+
+
+ {{ t('files_sharing', 'Read only') }}
+
+
+
+ {{ t('files_sharing', 'Allow upload and editing') }}
+
+
+
+
+
+
+
+ {{ t('files_sharing', 'Read only') }}
+
-
-
- {{ t('files_sharing', 'Allow deleting') }}
-
+
+ {{ t('files_sharing', 'Editing') }}
+
+
-
{{ config.isDefaultInternalExpireDateEnforced
@@ -149,6 +190,7 @@
import Avatar from '@nextcloud/vue/dist/Components/Avatar'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
+import ActionRadio from '@nextcloud/vue/dist/Components/ActionRadio'
import ActionCheckbox from '@nextcloud/vue/dist/Components/ActionCheckbox'
import ActionInput from '@nextcloud/vue/dist/Components/ActionInput'
import ActionTextEditable from '@nextcloud/vue/dist/Components/ActionTextEditable'
@@ -162,6 +204,7 @@ export default {
components: {
Actions,
ActionButton,
+ ActionRadio,
ActionCheckbox,
ActionInput,
ActionTextEditable,
@@ -181,10 +224,34 @@ export default {
permissionsDelete: OC.PERMISSION_DELETE,
permissionsRead: OC.PERMISSION_READ,
permissionsShare: OC.PERMISSION_SHARE,
+
+ publicUploadRWValue: OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_READ | OC.PERMISSION_DELETE,
+ publicUploadRValue: OC.PERMISSION_READ,
+ publicUploadWValue: OC.PERMISSION_CREATE | OC.PERMISSION_READ,
+ publicUploadEValue: OC.PERMISSION_UPDATE | OC.PERMISSION_READ,
}
},
computed: {
+ /**
+ * Return the current share permissions
+ * We always ignore the SHARE permission as this is used for the
+ * federated sharing.
+ * @returns {number}
+ */
+ sharePermissions() {
+ return this.share.permissions & ~OC.PERMISSION_SHARE
+ },
+ /**
+ * Generate a unique random id for this SharingEntryLink only
+ * This allows ActionRadios to have the same name prop
+ * but not to impact others SharingEntryLink
+ * @returns {string}
+ */
+ randomId() {
+ return Math.random().toString(27).substr(2)
+ },
+
title() {
let title = this.share.shareWithDisplayName
if (this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP) {
@@ -398,6 +465,17 @@ export default {
this.queueUpdate('permissions')
},
+ /**
+ * On permissions change
+ * @param {Event} event js event
+ */
+ togglePermissions(event) {
+ const permissions = parseInt(event.target.value, 10)
+ | (this.canReshare ? this.permissionsShare : 0)
+ this.share.permissions = permissions
+ this.queueUpdate('permissions')
+ },
+
/**
* Save potential changed data on menu close
*/
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue
index 37e5285075444..56cd043975b2f 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -178,12 +178,23 @@
-
- {{ t('files_sharing', 'Allow editing') }}
-
+
+
+ {{ t('files_sharing', 'Read only') }}
+
+
+
+ {{ t('files_sharing', 'Editing') }}
+
+
Date: Wed, 25 Aug 2021 08:59:47 +0530
Subject: [PATCH 2/4] removed upwanted code
---
.../src/components/SharingEntry.vue | 65 +++++--------------
1 file changed, 18 insertions(+), 47 deletions(-)
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index ed9f3b6891428..127bed8418058 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -45,53 +45,24 @@
@close="onMenuClose">
-
-
-
-
- {{ t('files_sharing', 'Allow editing') }}
-
-
-
-
- {{ t('files_sharing', 'Allow creating') }}
-
-
-
-
- {{ t('files_sharing', 'Allow deleting') }}
-
-
-
-
- {{ t('files_sharing', 'Read only') }}
-
-
-
- {{ t('files_sharing', 'Allow upload and editing') }}
-
-
-
+
+
+
+ {{ t('files_sharing', 'Read only') }}
+
+
+
+ {{ t('files_sharing', 'Allow upload and editing') }}
+
+
From 03c46f2339be7f005a3f50e8b9856ff01f74f57a Mon Sep 17 00:00:00 2001
From: Yogesh Shejwadkar
Date: Wed, 25 Aug 2021 20:53:26 +0530
Subject: [PATCH 3/4] NMC-431 added a new dropdown button under the display of
the email-address or account name of the recipient
Signed-off-by: Yogesh Shejwadkar
---
.../src/components/SharingEntry.vue | 34 +++++++++++++++++
.../src/components/SharingEntryLink.vue | 37 +++++++++++++++++++
2 files changed, 71 insertions(+)
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index 127bed8418058..22533235ea507 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -38,6 +38,27 @@
{{ share.status.icon || '' }}
{{ share.status.message || '' }}
+
+
+
+
+
+
+
+
+
+
+
{{ subtitle }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -587,6 +612,18 @@ export default {
},
},
+ /**
+ * Can the sharee edit the shared file ?
+ */
+ canEdit: {
+ get() {
+ return this.share.hasUpdatePermission
+ },
+ set(checked) {
+ this.updatePermissions({ isEditChecked: checked })
+ },
+ },
+
// if newPassword exists, but is empty, it means
// the user deleted the original password
hasUnsavedPassword() {
From b6871706d5c5ea2084c955aef6a49ea498232ae6 Mon Sep 17 00:00:00 2001
From: TSI-yogeshshejwadkar
<88780169+TSI-yogeshshejwadkar@users.noreply.github.com>
Date: Thu, 2 Sep 2021 14:30:12 +0530
Subject: [PATCH 4/4] Update apps/files_sharing/src/components/SharingEntry.vue
Co-authored-by: Pytal <24800714+Pytal@users.noreply.github.com>
---
apps/files_sharing/src/components/SharingEntry.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index 22533235ea507..865ca8d6b6571 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -413,7 +413,7 @@ export default {
* @returns {boolean}
*/
fileHasCreatePermission() {
- return !!(this.fileInfo.permissions & OC.PERMISSION_CREATE)
+ return Boolean(this.fileInfo.permissions & OC.PERMISSION_CREATE)
},
/**