Skip to content

Commit 85264ee

Browse files
committed
feat: hide "External Shares" section if no external shares can be created
Signed-off-by: Robin Appelman <[email protected]>
1 parent cd1c45d commit 85264ee

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

apps/files_sharing/lib/Listener/LoadSidebarListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ public function handle(Event $event): void {
4343
$showFederatedToTrustedAsInternal = $gsConfig->isGlobalScaleEnabled() || $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_TO_TRUSTED_AS_INTERNAL);
4444
$showFederatedAsInternal = ($gsConfig->isGlobalScaleEnabled() && $gsConfig->onlyInternalFederation())
4545
|| $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL);
46+
$showExternalSharing = $appConfig->getValueBool('files_sharing', 'outgoing_server2server_share_enabled', true)
47+
|| $appConfig->getValueBool('core', 'shareapi_allow_links', true);
4648

4749
$this->initialState->provideInitialState('showFederatedSharesAsInternal', $showFederatedAsInternal);
4850
$this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $showFederatedToTrustedAsInternal);
51+
$this->initialState->provideInitialState('showExternalSharing', $showExternalSharing);
4952
}
5053
}

apps/files_sharing/src/services/ConfigService.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,11 @@ export default class Config {
329329
get showFederatedSharesToTrustedServersAsInternal(): boolean {
330330
return loadState('files_sharing', 'showFederatedSharesToTrustedServersAsInternal', false)
331331
}
332+
333+
/**
334+
* Show the external share ui
335+
*/
336+
get showExternalSharing(): boolean {
337+
return loadState('files_sharing', 'showExternalSharing', true)
338+
}
332339
}

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<SharingEntryInternal :file-info="fileInfo" />
7373
</section>
7474

75-
<section>
75+
<section v-if="config.showExternalSharing">
7676
<div class="section-header">
7777
<h4>{{ t('files_sharing', 'External shares') }}</h4>
7878
<NcPopover popup-role="dialog">

0 commit comments

Comments
 (0)