From d5527e9ab8d12d55a8ab98877899f739d2f76034 Mon Sep 17 00:00:00 2001 From: Corentin Damman Date: Fri, 16 Sep 2022 17:43:01 +0200 Subject: [PATCH] feat(files_sharing): allow to specify allowed groups to share instead of excluded groups Relates to #3387 Signed-off-by: Corentin Damman --- apps/settings/lib/Settings/Admin/Sharing.php | 2 +- .../components/AdminSettingsSharingForm.vue | 36 +++++++++++++------ .../tests/Settings/Admin/SharingTest.php | 4 +-- dist/settings-vue-settings-admin-sharing.js | 4 +-- ...settings-vue-settings-admin-sharing.js.map | 2 +- .../Contacts/ContactsMenu/ContactsStore.php | 16 ++++++--- lib/private/Share20/ShareDisableChecker.php | 32 ++++++++++++----- tests/lib/Share20/ManagerTest.php | 11 ++++-- 8 files changed, 77 insertions(+), 30 deletions(-) diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php index fc8b811eccdfa..ec9dc0ddfd1cb 100644 --- a/apps/settings/lib/Settings/Admin/Sharing.php +++ b/apps/settings/lib/Settings/Admin/Sharing.php @@ -88,7 +88,7 @@ public function getForm() { 'defaultExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_default_expire_date'), 'expireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'), 'enforceExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_enforce_expire_date'), - 'excludeGroups' => $this->getHumanBooleanConfig('core', 'shareapi_exclude_groups'), + 'excludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no'), 'excludeGroupsList' => json_decode($excludedGroups, true) ?? [], 'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null), 'enableLinkPasswordByDefault' => $this->getHumanBooleanConfig('core', 'shareapi_enable_link_password_by_default'), diff --git a/apps/settings/src/components/AdminSettingsSharingForm.vue b/apps/settings/src/components/AdminSettingsSharingForm.vue index 6850ab7424342..122b3dfc6421c 100644 --- a/apps/settings/src/components/AdminSettingsSharingForm.vue +++ b/apps/settings/src/components/AdminSettingsSharingForm.vue @@ -76,19 +76,31 @@ - - {{ t('settings', 'Exclude groups from sharing') }} - -