From de286709f8bdff40ffbeda79efd3f22c4d031469 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 12 Nov 2025 17:37:31 +0100 Subject: [PATCH] feat: hide "External Shares" section if no external shares can be created Signed-off-by: Robin Appelman --- apps/files_sharing/lib/Listener/LoadSidebarListener.php | 3 +++ apps/files_sharing/src/services/ConfigService.ts | 7 +++++++ apps/files_sharing/src/views/SharingTab.vue | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index 17fee71978f..935f88ae753 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -43,8 +43,11 @@ class LoadSidebarListener implements IEventListener { $showFederatedToTrustedAsInternal = $gsConfig->isGlobalScaleEnabled() || $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_TO_TRUSTED_AS_INTERNAL); $showFederatedAsInternal = ($gsConfig->isGlobalScaleEnabled() && $gsConfig->onlyInternalFederation()) || $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL); + $showExternalSharing = $appConfig->getValueBool('files_sharing', 'outgoing_server2server_share_enabled', true) + || $appConfig->getValueBool('core', 'shareapi_allow_links', true); $this->initialState->provideInitialState('showFederatedSharesAsInternal', $showFederatedAsInternal); $this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $showFederatedToTrustedAsInternal); + $this->initialState->provideInitialState('showExternalSharing', $showExternalSharing); } } diff --git a/apps/files_sharing/src/services/ConfigService.ts b/apps/files_sharing/src/services/ConfigService.ts index 8c17c6f3a17..71824bc855b 100644 --- a/apps/files_sharing/src/services/ConfigService.ts +++ b/apps/files_sharing/src/services/ConfigService.ts @@ -329,4 +329,11 @@ export default class Config { get showFederatedSharesToTrustedServersAsInternal(): boolean { return loadState('files_sharing', 'showFederatedSharesToTrustedServersAsInternal', false) } + + /** + * Show the external share ui + */ + get showExternalSharing(): boolean { + return loadState('files_sharing', 'showExternalSharing', true) + } } diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index 784958c5aed..e3af8e39b28 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -72,7 +72,7 @@ -
+

{{ t('files_sharing', 'External shares') }}