diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index 8167172ceeae3..865ca8d6b6571 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -38,40 +38,71 @@
{{ share.status.icon || '' }}
{{ share.status.message || '' }}
+
+
+
+
+
+
+
+
+
+
+
-
-
- {{ t('files_sharing', 'Allow editing') }}
-
+
+
-
-
- {{ t('files_sharing', 'Allow creating') }}
-
+
+ {{ t('files_sharing', 'Read only') }}
+
-
-
- {{ t('files_sharing', 'Allow deleting') }}
-
+
+ {{ t('files_sharing', 'Allow upload and editing') }}
+
+
+
+
+
+
+ {{ t('files_sharing', 'Read only') }}
+
+
+
+ {{ t('files_sharing', 'Editing') }}
+
+
-
{{ config.isDefaultInternalExpireDateEnforced
@@ -149,6 +182,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 +196,7 @@ export default {
components: {
Actions,
ActionButton,
+ ActionRadio,
ActionCheckbox,
ActionInput,
ActionTextEditable,
@@ -181,10 +216,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) {
@@ -225,6 +284,10 @@ export default {
return !this.isRemote
},
+ canHaveExpirationDate() {
+ return !this.isRemoteShare
+ },
+
isRemote() {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE
|| this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
@@ -344,6 +407,15 @@ export default {
return this.fileInfo.type === 'dir'
},
+ /**
+ * Does the current file/folder have create permissions
+ * TODO: move to a proper FileInfo model?
+ * @returns {boolean}
+ */
+ fileHasCreatePermission() {
+ return Boolean(this.fileInfo.permissions & OC.PERMISSION_CREATE)
+ },
+
/**
* Does the current share have an expiration date
* @returns {boolean}
@@ -398,6 +470,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..aed14294cdc4a 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -32,6 +32,31 @@
{{ subtitle }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -178,12 +203,23 @@
-
- {{ t('files_sharing', 'Allow editing') }}
-
+
+
+ {{ t('files_sharing', 'Read only') }}
+
+
+
+ {{ t('files_sharing', 'Editing') }}
+
+