From 263cb21c24d9014f4569376877546ff7f7031cb1 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 1 Dec 2023 13:30:46 +0100 Subject: [PATCH] Add config var UserListRequiresFilter (#7866) * Add config var UserListRequiresFilter * Fix whitespace * Update options.go Co-authored-by: Martin --------- Co-authored-by: Martin --- .../enhancement-add-user-list-requires-filter-config.md | 5 +++++ services/web/pkg/config/defaults/defaultconfig.go | 1 + services/web/pkg/config/options.go | 1 + 3 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/enhancement-add-user-list-requires-filter-config.md diff --git a/changelog/unreleased/enhancement-add-user-list-requires-filter-config.md b/changelog/unreleased/enhancement-add-user-list-requires-filter-config.md new file mode 100644 index 0000000000..635990d4d2 --- /dev/null +++ b/changelog/unreleased/enhancement-add-user-list-requires-filter-config.md @@ -0,0 +1,5 @@ +Enhancement: Add user list requires filter config + +Introduce a config to require filters in order to list users in Web via `WEB_OPTION_USER_LIST_REQUIRES_FILTER`. + +https://github.com/owncloud/ocis/pull/7866 diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index 7a5df818f5..2bfc5ab87a 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -127,6 +127,7 @@ func DefaultConfig() *config.Config { Upload: &config.Upload{}, OpenLinksWithDefaultApp: true, TokenStorageLocal: true, + UserListRequiresFilter: false, }, }, }, diff --git a/services/web/pkg/config/options.go b/services/web/pkg/config/options.go index bf1ae8f907..8fe29acbc5 100644 --- a/services/web/pkg/config/options.go +++ b/services/web/pkg/config/options.go @@ -27,6 +27,7 @@ type Options struct { TokenStorageLocal bool `json:"tokenStorageLocal" yaml:"tokenStorageLocal" env:"WEB_OPTION_TOKEN_STORAGE_LOCAL" desc:"Specifies whether the access token will be stored in the local storage when set to 'true' or in the session storage when set to 'false'. If stored in the local storage, login state will be persisted across multiple browser tabs, means no additional logins are required."` DisabledExtensions []string `json:"disabledExtensions,omitempty" yaml:"disabledExtensions" env:"WEB_OPTION_DISABLED_EXTENSIONS" desc:"A list to disable specific Web extensions identified by their ID. The ID can e.g. be taken from the 'index.ts' file of the web extension. Example: 'com.github.owncloud.web.files.search,com.github.owncloud.web.files.print'. See the Environment Variable Types description for more details."` Embed *Embed `json:"embed,omitempty" yaml:"embed"` + UserListRequiresFilter bool `json:"userListRequiresFilter,omitempty" yaml:"userListRequiresFilter" env:"WEB_OPTION_USER_LIST_REQUIRES_FILTER" desc:"Defines whether one ore more filters must be set in order to list users in the Web admin settings. Set this option to 'true' if running in an environment with a lot of users and listing all users could slow down performance. Defaults to 'false'."` } // AccountEditLink are the AccountEditLink options