mirror of https://github.com/grafana/grafana.git
				
				
				
			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:
		
							parent
							
								
									6eca5c09df
								
							
						
					
					
						commit
						a112ef6467
					
				|  | @ -527,9 +527,11 @@ external_manage_link_url = | ||||||
| external_manage_link_name = | external_manage_link_name = | ||||||
| external_manage_info = | 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/inspect dashboard settings in the browser. But not save the dashboard. | ||||||
| viewers_can_edit = false | viewers_can_edit = false | ||||||
| 
 | 
 | ||||||
|  | # Deprecated: Assign your editors to admins. | ||||||
| # Editors can administrate dashboard, folders and teams they create | # Editors can administrate dashboard, folders and teams they create | ||||||
| editors_can_admin = false | editors_can_admin = false | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -528,9 +528,12 @@ | ||||||
| ;external_manage_link_name = | ;external_manage_link_name = | ||||||
| ;external_manage_info = | ;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/inspect dashboard settings in the browser. But not save the dashboard. | ||||||
| ;viewers_can_edit = false | ;viewers_can_edit = false | ||||||
| 
 | 
 | ||||||
|  | # Deprecated: Assign your editors to admins. | ||||||
| # Editors can administrate dashboard, folders and teams they create | # Editors can administrate dashboard, folders and teams they create | ||||||
| ;editors_can_admin = false | ;editors_can_admin = false | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -294,8 +294,8 @@ type Cfg struct { | ||||||
| 	// DistributedCache
 | 	// DistributedCache
 | ||||||
| 	RemoteCacheOptions *RemoteCacheSettings | 	RemoteCacheOptions *RemoteCacheSettings | ||||||
| 
 | 
 | ||||||
| 	ViewersCanEdit  bool | 	ViewersCanEdit  bool // Deprecated: no longer used
 | ||||||
| 	EditorsCanAdmin bool | 	EditorsCanAdmin bool // Deprecated: no longer used
 | ||||||
| 
 | 
 | ||||||
| 	ApiKeyMaxSecondsToLive int64 | 	ApiKeyMaxSecondsToLive int64 | ||||||
| 
 | 
 | ||||||
|  | @ -1729,8 +1729,16 @@ func readUserSettings(iniFile *ini.File, cfg *Cfg) error { | ||||||
| 	cfg.ExternalUserMngAnalytics = users.Key("external_manage_analytics").MustBool(false) | 	cfg.ExternalUserMngAnalytics = users.Key("external_manage_analytics").MustBool(false) | ||||||
| 	cfg.ExternalUserMngAnalyticsParams = valueAsString(users, "external_manage_analytics_params", "") | 	cfg.ExternalUserMngAnalyticsParams = valueAsString(users, "external_manage_analytics_params", "") | ||||||
| 
 | 
 | ||||||
|  | 	// Deprecated
 | ||||||
| 	cfg.ViewersCanEdit = users.Key("viewers_can_edit").MustBool(false) | 	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) | 	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") | 	userInviteMaxLifetimeVal := valueAsString(users, "user_invite_max_lifetime_duration", "24h") | ||||||
| 	userInviteMaxLifetimeDuration, err := gtime.ParseDuration(userInviteMaxLifetimeVal) | 	userInviteMaxLifetimeDuration, err := gtime.ParseDuration(userInviteMaxLifetimeVal) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue