aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBaptiste Fotia <fotia.baptiste@hotmail.com>2023-12-27 12:56:23 +0100
committerBaptiste Fotia <fotia.baptiste@hotmail.com>2024-01-31 10:44:40 +0100
commit9af96d9f9ac512d8082cd20303068f06646b4a93 (patch)
tree9c0c1b4b99a3089f992c0ad7e8e1c446298f85bd /apps
parent7cb7b8b6c3ba0b2c652ad3a6922081388f4c026f (diff)
downloadnextcloud-server-9af96d9f9ac512d8082cd20303068f06646b4a93.tar.gz
nextcloud-server-9af96d9f9ac512d8082cd20303068f06646b4a93.zip
feat(php,vue): Create a new parameter
Signed-off-by: Baptiste Fotia <fotia.baptiste@hotmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Settings/Admin/Sharing.php2
-rw-r--r--apps/settings/src/components/AdminSettingsSharingForm.vue8
-rw-r--r--apps/settings/tests/Settings/Admin/SharingTest.php2
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php
index f4d3a5c107b..fc8b811eccd 100644
--- a/apps/settings/lib/Settings/Admin/Sharing.php
+++ b/apps/settings/lib/Settings/Admin/Sharing.php
@@ -63,6 +63,7 @@ class Sharing implements IDelegatedSettings {
$excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
$linksExcludedGroups = $this->config->getAppValue('core', 'shareapi_allow_links_exclude_groups', '');
$excludedPasswordGroups = $this->config->getAppValue('core', 'shareapi_enforce_links_password_excluded_groups', '');
+ $onlyShareWithGroupMembersExcludeGroupList = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members_exclude_group_list', '');
$parameters = [
// Built-In Sharing
@@ -83,6 +84,7 @@ class Sharing implements IDelegatedSettings {
'passwordExcludedGroups' => json_decode($excludedPasswordGroups) ?? [],
'passwordExcludedGroupsFeatureEnabled' => $this->config->getSystemValueBool('sharing.allow_disabled_password_enforcement_groups', false),
'onlyShareWithGroupMembers' => $this->shareManager->shareWithGroupMembersOnly(),
+ 'onlyShareWithGroupMembersExcludeGroupList' => json_decode($onlyShareWithGroupMembersExcludeGroupList) ?? [],
'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'),
diff --git a/apps/settings/src/components/AdminSettingsSharingForm.vue b/apps/settings/src/components/AdminSettingsSharingForm.vue
index 2165303349f..6850ab74243 100644
--- a/apps/settings/src/components/AdminSettingsSharingForm.vue
+++ b/apps/settings/src/components/AdminSettingsSharingForm.vue
@@ -37,6 +37,13 @@
<NcCheckboxRadioSwitch :checked.sync="settings.onlyShareWithGroupMembers">
{{ t('settings', 'Restrict users to only share with users in their groups') }}
</NcCheckboxRadioSwitch>
+ <div v-show="settings.onlyShareWithGroupMembers" id="settings-sharing-api-excluded-groups" class="sharing__labeled-entry sharing__input">
+ <label for="settings-sharing-only-group-members-excluded-groups">{{ t('settings', 'Ignore the following groups when checking group membership') }}</label>
+ <NcSettingsSelectGroup id="settings-sharing-only-group-members-excluded-groups"
+ v-model="settings.onlyShareWithGroupMembersExcludeGroupList"
+ :label="t('settings', 'Ignore the following groups when checking group membership')"
+ style="width: 100%" />
+ </div>
</div>
<div v-show="settings.enabled" id="settings-sharing-api" class="sharing__section">
@@ -216,6 +223,7 @@ interface IShareSettings {
passwordExcludedGroups: string[]
passwordExcludedGroupsFeatureEnabled: boolean
onlyShareWithGroupMembers: boolean
+ onlyShareWithGroupMembersExcludeGroupList: string[]
defaultExpireDate: boolean
expireAfterNDays: string
enforceExpireDate: boolean
diff --git a/apps/settings/tests/Settings/Admin/SharingTest.php b/apps/settings/tests/Settings/Admin/SharingTest.php
index b34c4945774..7dd4e56bcd2 100644
--- a/apps/settings/tests/Settings/Admin/SharingTest.php
+++ b/apps/settings/tests/Settings/Admin/SharingTest.php
@@ -163,6 +163,7 @@ class SharingTest extends TestCase {
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
+ 'onlyShareWithGroupMembersExcludeGroupList' => [],
]
],
);
@@ -254,6 +255,7 @@ class SharingTest extends TestCase {
'allowLinksExcludeGroups' => [],
'passwordExcludedGroups' => [],
'passwordExcludedGroupsFeatureEnabled' => false,
+ 'onlyShareWithGroupMembersExcludeGroupList' => [],
]
],
);