diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 4fe47bee..a4355458 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -109,6 +109,9 @@ class PublicController extends AuthPublicShareController // Video configuration $this->initialState->provideInitialState('notranscode', $this->config->getSystemValue('memories.no_transcode', 'UNSET')); + // Share info + $this->initialState->provideInitialState('no_download', $share->getHideDownload()); + $policy = new ContentSecurityPolicy(); $policy->addAllowedWorkerSrcDomain("'self'"); $policy->addAllowedScriptDomain("'self'"); diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 05c513c3..f9bd1241 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -157,6 +157,7 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) { icon: DownloadIcon, callback: this.downloadSelection.bind(this), allowPublic: true, + if: () => !this.allowDownload(), }, { name: t("memories", "Favorite"), @@ -216,6 +217,11 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) { }; } + /** Download is not allowed on some public shares */ + private allowDownload(): boolean { + return this.state_noDownload; + } + /** Archive is not allowed only on folder routes */ private allowArchive() { return this.$route.name !== "folders"; diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index 93521d5e..13e24c2c 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -82,6 +82,7 @@ :aria-label="t('memories', 'Download')" @click="downloadCurrent" :close-after-click="true" + v-if="!this.state_noDownload" > {{ t("memories", "Download") }}