diff options
author | Corentin Damman <c.damman@intopix.com> | 2022-09-16 17:43:01 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-03-15 16:52:59 +0100 |
commit | 0fa9f3049f20ee4d573a6c615ebf9e7ecf7abdd1 (patch) | |
tree | 29110a4f03ce26db4419817aec2b2e996b22bd27 /apps/settings/src/components/AdminSettingsSharingForm.vue | |
parent | a0913739c68d9c4263fc0a9fa7e58f4276458f45 (diff) | |
download | nextcloud-server-0fa9f3049f20ee4d573a6c615ebf9e7ecf7abdd1.tar.gz nextcloud-server-0fa9f3049f20ee4d573a6c615ebf9e7ecf7abdd1.zip |
feat(files_sharing): allow to specify allowed groups to share instead of excluded groups
Relates to #3387
Signed-off-by: Corentin Damman <c.damman@intopix.com>
Diffstat (limited to 'apps/settings/src/components/AdminSettingsSharingForm.vue')
-rw-r--r-- | apps/settings/src/components/AdminSettingsSharingForm.vue | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/apps/settings/src/components/AdminSettingsSharingForm.vue b/apps/settings/src/components/AdminSettingsSharingForm.vue index 6850ab74243..122b3dfc642 100644 --- a/apps/settings/src/components/AdminSettingsSharingForm.vue +++ b/apps/settings/src/components/AdminSettingsSharingForm.vue @@ -76,19 +76,31 @@ </label> </fieldset> - <NcCheckboxRadioSwitch type="switch" :checked.sync="settings.excludeGroups"> - {{ t('settings', 'Exclude groups from sharing') }} - </NcCheckboxRadioSwitch> - <div v-show="settings.excludeGroups" class="sharing__sub-section"> - <div class="sharing__labeled-entry sharing__input"> - <label for="settings-sharing-excluded-groups">{{ t('settings', 'Groups excluded from sharing') }}</label> + <label>{{ t('settings', 'Limit sharing based on groups') }}</label> + <div class="sharing__sub-section"> + <NcCheckboxRadioSwitch :checked.sync="settings.excludeGroups" + name="excludeGroups" value="no" + type="radio" @update:checked="onUpdateExcludeGroups"> + {{ t('settings', 'Allow sharing for everyone (default)') }} + </NcCheckboxRadioSwitch> + <NcCheckboxRadioSwitch :checked.sync="settings.excludeGroups" + name="excludeGroups" value="yes" + type="radio" @update:checked="onUpdateExcludeGroups"> + {{ t('settings', 'Exclude some groups from sharing') }} + </NcCheckboxRadioSwitch> + <NcCheckboxRadioSwitch :checked.sync="settings.excludeGroups" + name="excludeGroups" value="allow" + type="radio" @update:checked="onUpdateExcludeGroups"> + {{ t('settings', 'Limit sharing to some groups') }} + </NcCheckboxRadioSwitch> + <div v-show="settings.excludeGroups !== 'no'" class="sharing__labeled-entry sharing__input"> <NcSettingsSelectGroup id="settings-sharing-excluded-groups" v-model="settings.excludeGroupsList" aria-describedby="settings-sharing-excluded-groups-desc" - :label="t('settings', 'Groups excluded from sharing')" - :disabled="!settings.excludeGroups" + :label="settings.excludeGroups === 'allow' ? t('settings', 'Groups allowed to share') : t('settings', 'Groups excluded from sharing')" + :disabled="settings.excludeGroups === 'no'" style="width: 100%" /> - <em id="settings-sharing-excluded-groups-desc">{{ t('settings', 'These groups will still be able to receive shares, but not to initiate them.') }}</em> + <em id="settings-sharing-excluded-groups-desc">{{ t('settings', 'Not allowed groups will still be able to receive shares, but not to initiate them.') }}</em> </div> </div> @@ -227,7 +239,7 @@ interface IShareSettings { defaultExpireDate: boolean expireAfterNDays: string enforceExpireDate: boolean - excludeGroups: boolean + excludeGroups: string excludeGroupsList: string[] publicShareDisclaimerText?: string enableLinkPasswordByDefault: boolean @@ -306,6 +318,10 @@ export default defineComponent({ } this.settingsData.publicShareDisclaimerText = value }, 500) as (v?: string) => void, + onUpdateExcludeGroups: debounce(function(value: string) { + window.OCP.AppConfig.setValue('core', 'excludeGroups', value) + this.settings.excludeGroups = value + }, 500) as (v?: string) => void }, }) </script> |