]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: Only show share permission if re-sharable fix/no-issue/no-reshare-perms-4-email-shares 49351/head
authornfebe <fenn25.fn@gmail.com>
Mon, 18 Nov 2024 16:43:43 +0000 (17:43 +0100)
committernfebe <fenn25.fn@gmail.com>
Mon, 18 Nov 2024 19:16:21 +0000 (20:16 +0100)
Signed-off-by: nfebe <fenn25.fn@gmail.com>
apps/files_sharing/src/views/SharingDetailsTab.vue

index 3ed492344a2a5e8bb8172b378cb11361da2be21e..0fd264280ce8315d2051d89cf29124ee1d81d055 100644 (file)
                                                        data-cy-files-sharing-share-permissions-checkbox="update">
                                                        {{ t('files_sharing', 'Edit') }}
                                                </NcCheckboxRadioSwitch>
-                                               <NcCheckboxRadioSwitch v-if="config.isResharingAllowed && share.type !== ShareType.Link"
+                                               <NcCheckboxRadioSwitch v-if="resharingIsPossible"
                                                        :disabled="!canSetReshare"
                                                        :checked.sync="canReshare"
                                                        data-cy-files-sharing-share-permissions-checkbox="share">
@@ -556,6 +556,9 @@ export default {
                        return t('files_sharing', 'Update share')
 
                },
+               resharingIsPossible() {
+                       return this.config.isResharingAllowed && this.share.type !== ShareType.Link && this.share.type !== ShareType.Email
+               },
                /**
                 * Can the sharer set whether the sharee can edit the file ?
                 *
@@ -705,7 +708,7 @@ export default {
                                [ATOMIC_PERMISSIONS.DELETE]: this.t('files_sharing', 'Delete'),
                        }
 
-                       return [ATOMIC_PERMISSIONS.READ, ATOMIC_PERMISSIONS.CREATE, ATOMIC_PERMISSIONS.UPDATE, ATOMIC_PERMISSIONS.SHARE, ATOMIC_PERMISSIONS.DELETE]
+                       return [ATOMIC_PERMISSIONS.READ, ATOMIC_PERMISSIONS.CREATE, ATOMIC_PERMISSIONS.UPDATE, ...(this.resharingIsPossible ? [ATOMIC_PERMISSIONS.SHARE] : []), ATOMIC_PERMISSIONS.DELETE]
                                .filter((permission) => hasPermissions(this.share.permissions, permission))
                                .map((permission, index) => index === 0
                                        ? translatedPermissions[permission]