From 9bd202065070b311e808ec190f77274091b0b27b Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Thu, 15 May 2025 15:35:37 +0200 Subject: [PATCH 1/4] feat: Add option to set secure view for public talk shares Signed-off-by: Julius Knorr --- lib/Controller/SettingsController.php | 1 + lib/PermissionManager.php | 6 +++++ src/components/AdminSettings.vue | 34 ++++++++++++++++----------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 4f85df20d0..9ac94a2bc1 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -213,6 +213,7 @@ public function updateWatermarkSettings($settings = []): JSONResponse { 'watermark_shareAll', 'watermark_shareRead', 'watermark_shareDisabledDownload', + 'watermark_shareTalkPublic', 'watermark_linkSecure', 'watermark_linkRead', 'watermark_linkAll', diff --git a/lib/PermissionManager.php b/lib/PermissionManager.php index 49f0a79eaa..a319885eba 100644 --- a/lib/PermissionManager.php +++ b/lib/PermissionManager.php @@ -162,6 +162,12 @@ public function shouldWatermark(Node $node, ?string $userId = null, ?IShare $sha return true; } + if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareTalkPublic', 'no') === 'yes') { + if ($userId === null && $share->getShareType() === IShare::TYPE_ROOM) { + return true; + } + } + if ($userId !== null && $this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allGroups', 'no') === 'yes') { $groups = $this->appConfig->getAppValueArray('watermark_allGroupsList'); foreach ($groups as $group) { diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index fb6ca9e4b9..492ea11d98 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -310,16 +310,16 @@

{{ t('richdocuments', 'Secure View') }}

-

{{ t('richdocuments', 'Secure view enables you to secure documents by embedding a watermark') }}

+

{{ t('richdocuments', 'Secure view enables you to secure office documents by blocking downloads, previews and showing a watermark') }}

  • {{ t('richdocuments', 'The settings only apply to compatible office files that are opened in Nextcloud Office') }}
  • +
  • {{ t('richdocuments', 'Downloading the file through WebDAV will be blocked') }}
  • {{ t('richdocuments', 'The following options within Nextcloud Office will be disabled: Copy, Download, Export, Print') }}
  • -
  • {{ t('richdocuments', 'Files may still be downloadable through Nextcloud unless restricted otherwise through sharing or access control settings') }}
  • {{ t('richdocuments', 'Files may still be downloadable via WOPI requests if WOPI settings are not correctly configured') }}
  • -
  • {{ t('richdocuments', 'Previews will be blocked for watermarked files to not leak the first page of documents') }}
  • +
  • {{ t('richdocuments', 'Previews will be blocked') }}
@@ -331,62 +331,67 @@ @update="update" />

+

Link shares

- +

@@ -512,6 +517,7 @@ export default { enabled: false, shareAll: false, shareRead: false, + shareTalkPublic: true, linkSecure: false, linkRead: false, linkAll: false, From c13e65832ad4d0d6f844fb5d6f3bb0d6a7178633 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 16 May 2025 08:34:36 +0200 Subject: [PATCH 2/4] chore: Move settings checkbox and input to nextcloud-vue components Signed-off-by: Julius Knorr --- src/components/SettingsCheckbox.vue | 36 ++++++++++----------- src/components/SettingsInputText.vue | 48 ++++++++++++---------------- 2 files changed, 36 insertions(+), 48 deletions(-) diff --git a/src/components/SettingsCheckbox.vue b/src/components/SettingsCheckbox.vue index 6266dca574..c1aee937f4 100644 --- a/src/components/SettingsCheckbox.vue +++ b/src/components/SettingsCheckbox.vue @@ -5,14 +5,12 @@ diff --git a/src/components/SettingsInputText.vue b/src/components/SettingsInputText.vue index ef39e3269c..19b42e8473 100644 --- a/src/components/SettingsInputText.vue +++ b/src/components/SettingsInputText.vue @@ -6,26 +6,29 @@