Authz: Add deprecation notice for settings `viewers_can_edit` and `editors_can_admin` (#100947)

* deprecate settings viewers_can_edit editors_can_admin

* add back variables for tests

* delete the files from cached in gti
This commit is contained in:
Eric Leijonmarck 2025-02-21 11:17:11 +00:00 committed by GitHub
parent 6eca5c09df
commit a112ef6467
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 2 deletions

View File

@ -527,9 +527,11 @@ external_manage_link_url =
external_manage_link_name =
external_manage_info =
# Deprecated: Assign your viewers to editors.
# Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.
viewers_can_edit = false
# Deprecated: Assign your editors to admins.
# Editors can administrate dashboard, folders and teams they create
editors_can_admin = false

View File

@ -528,9 +528,12 @@
;external_manage_link_name =
;external_manage_info =
# Deprecated: Assign your viewers to editors.
# Viewers can edit/inspect dashboard settings in the browser. But not save the dashboard.
;viewers_can_edit = false
# Deprecated: Assign your editors to admins.
# Editors can administrate dashboard, folders and teams they create
;editors_can_admin = false

View File

@ -294,8 +294,8 @@ type Cfg struct {
// DistributedCache
RemoteCacheOptions *RemoteCacheSettings
ViewersCanEdit bool
EditorsCanAdmin bool
ViewersCanEdit bool // Deprecated: no longer used
EditorsCanAdmin bool // Deprecated: no longer used
ApiKeyMaxSecondsToLive int64
@ -1729,8 +1729,16 @@ func readUserSettings(iniFile *ini.File, cfg *Cfg) error {
cfg.ExternalUserMngAnalytics = users.Key("external_manage_analytics").MustBool(false)
cfg.ExternalUserMngAnalyticsParams = valueAsString(users, "external_manage_analytics_params", "")
// Deprecated
cfg.ViewersCanEdit = users.Key("viewers_can_edit").MustBool(false)
if cfg.ViewersCanEdit {
cfg.Logger.Warn("[Deprecated] The viewers_can_edit configuration setting is deprecated. Please upgrade viewers to editors.")
}
// Deprecated
cfg.EditorsCanAdmin = users.Key("editors_can_admin").MustBool(false)
if cfg.EditorsCanAdmin {
cfg.Logger.Warn("[Deprecated] The editors_can_admin configuration setting is deprecated. Please upgrade editors to admin.")
}
userInviteMaxLifetimeVal := valueAsString(users, "user_invite_max_lifetime_duration", "24h")
userInviteMaxLifetimeDuration, err := gtime.ParseDuration(userInviteMaxLifetimeVal)