feat: add a config for default link permissions (#7783)

* feat: add a config for default link permissions

* Update services/frontend/pkg/config/config.go

---------

Co-authored-by: Martin <github@diemattels.at>
This commit is contained in:
Jannik Stehle
2023-11-23 07:59:31 +01:00
committed by GitHub
parent 6ac5ac534d
commit 8ee03101c0
4 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Enhancement: Default link permission config
A new config for default link permissions that is being announced via capabilities has been added. It defaults to 1 (= public link with viewer permissions).
https://github.com/owncloud/ocis/pull/7783
https://github.com/owncloud/web/issues/9919

View File

@@ -39,6 +39,7 @@ type Config struct {
SearchMinLength int `yaml:"search_min_length" env:"FRONTEND_SEARCH_MIN_LENGTH" desc:"Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed."`
Edition string `yaml:"edition" env:"OCIS_EDITION;FRONTEND_EDITION"`
DisableSSE bool `yaml:"disable_sse" env:"OCIS_DISABLE_SSE;FRONTEND_DISABLE_SSE" desc:"When set to true, clients are informed that the Server-Sent Events endpoint is not accessible."`
DefaultLinkPermissions int `yaml:"default_link_permissions" env:"FRONTEND_DEFAULT_LINK_PERMISSIONS" desc:"Defines the default permissions a link is being created with. Possible values are 0 (= internal link, for instance members only) and 1 (= public link with viewer permissions). Defaults to 1."`
PublicURL string `yaml:"public_url" env:"OCIS_URL;FRONTEND_PUBLIC_URL" desc:"The public facing URL of the oCIS frontend."`

View File

@@ -87,6 +87,7 @@ func DefaultConfig() *config.Config {
UploadHTTPMethodOverride: "",
DefaultUploadProtocol: "tus",
EnableResharing: true,
DefaultLinkPermissions: 1,
SearchMinLength: 3,
Edition: "Community",
Checksums: config.Checksums{

View File

@@ -247,6 +247,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"upload": true,
"multiple": true,
"supports_upload_only": true,
"default_permissions": cfg.DefaultLinkPermissions,
"password": map[string]interface{}{
"enforced": false,
"enforced_for": map[string]interface{}{