Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a config for default link permissions #7783

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/add-default-link-permission-config.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions services/frontend/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."`

Expand Down
1 change: 1 addition & 0 deletions services/frontend/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func DefaultConfig() *config.Config {
UploadHTTPMethodOverride: "",
DefaultUploadProtocol: "tus",
EnableResharing: true,
DefaultLinkPermissions: 1,
SearchMinLength: 3,
Edition: "Community",
Checksums: config.Checksums{
Expand Down
1 change: 1 addition & 0 deletions services/frontend/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand Down