Config: Remove setting editors_can_admin (#101607)
* Remove editors can admin * delete file * add ac_test back * Add linting ignore * more static ignore
This commit is contained in:
@@ -71,6 +71,7 @@ func (hs *HTTPServer) declareFixedRoles() error {
|
||||
Grants: []string{string(org.RoleEditor)},
|
||||
}
|
||||
|
||||
//nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility
|
||||
if hs.Cfg.ViewersCanEdit {
|
||||
datasourcesExplorerRole.Grants = append(datasourcesExplorerRole.Grants, string(org.RoleViewer))
|
||||
}
|
||||
@@ -256,9 +257,7 @@ func (hs *HTTPServer) declareFixedRoles() error {
|
||||
}
|
||||
|
||||
teamCreatorGrants := []string{string(org.RoleAdmin)}
|
||||
if hs.Cfg.EditorsCanAdmin {
|
||||
teamCreatorGrants = append(teamCreatorGrants, string(org.RoleEditor))
|
||||
}
|
||||
|
||||
teamsCreatorRole := ac.RoleRegistration{
|
||||
Role: ac.RoleDTO{
|
||||
Name: "fixed:teams:creator",
|
||||
|
||||
@@ -207,7 +207,6 @@ type FrontendSettingsDTO struct {
|
||||
ExternalUserMngAnalyticsParams string `json:"externalUserMngAnalyticsParams"`
|
||||
ViewersCanEdit bool `json:"viewersCanEdit"`
|
||||
AngularSupportEnabled bool `json:"angularSupportEnabled"`
|
||||
EditorsCanAdmin bool `json:"editorsCanAdmin"`
|
||||
DisableSanitizeHtml bool `json:"disableSanitizeHtml"`
|
||||
TrustedTypesDefaultPolicyEnabled bool `json:"trustedTypesDefaultPolicyEnabled"`
|
||||
CSPReportOnlyEnabled bool `json:"cspReportOnlyEnabled"`
|
||||
|
||||
+20
-20
@@ -228,26 +228,26 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
||||
ExternalUserMngLinkName: hs.Cfg.ExternalUserMngLinkName,
|
||||
ExternalUserMngAnalytics: hs.Cfg.ExternalUserMngAnalytics,
|
||||
ExternalUserMngAnalyticsParams: hs.Cfg.ExternalUserMngAnalyticsParams,
|
||||
ViewersCanEdit: hs.Cfg.ViewersCanEdit,
|
||||
AngularSupportEnabled: hs.Cfg.AngularSupportEnabled,
|
||||
EditorsCanAdmin: hs.Cfg.EditorsCanAdmin,
|
||||
DisableSanitizeHtml: hs.Cfg.DisableSanitizeHtml,
|
||||
TrustedTypesDefaultPolicyEnabled: trustedTypesDefaultPolicyEnabled,
|
||||
CSPReportOnlyEnabled: hs.Cfg.CSPReportOnlyEnabled,
|
||||
DateFormats: hs.Cfg.DateFormats,
|
||||
SecureSocksDSProxyEnabled: hs.Cfg.SecureSocksDSProxy.Enabled && hs.Cfg.SecureSocksDSProxy.ShowUI,
|
||||
EnableFrontendSandboxForPlugins: hs.Cfg.EnableFrontendSandboxForPlugins,
|
||||
PublicDashboardAccessToken: c.PublicDashboardAccessToken,
|
||||
PublicDashboardsEnabled: hs.Cfg.PublicDashboardsEnabled,
|
||||
CloudMigrationIsTarget: isCloudMigrationTarget,
|
||||
CloudMigrationFeedbackURL: hs.Cfg.CloudMigration.FeedbackURL,
|
||||
CloudMigrationPollIntervalMs: int(hs.Cfg.CloudMigration.FrontendPollInterval.Milliseconds()),
|
||||
SharedWithMeFolderUID: folder.SharedWithMeFolderUID,
|
||||
RootFolderUID: accesscontrol.GeneralFolderUID,
|
||||
LocalFileSystemAvailable: hs.Cfg.LocalFileSystemAvailable,
|
||||
ReportingStaticContext: hs.Cfg.ReportingStaticContext,
|
||||
ExploreDefaultTimeOffset: hs.Cfg.ExploreDefaultTimeOffset,
|
||||
ExploreHideLogsDownload: hs.Cfg.ExploreHideLogsDownload,
|
||||
//nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility
|
||||
ViewersCanEdit: hs.Cfg.ViewersCanEdit,
|
||||
AngularSupportEnabled: hs.Cfg.AngularSupportEnabled,
|
||||
DisableSanitizeHtml: hs.Cfg.DisableSanitizeHtml,
|
||||
TrustedTypesDefaultPolicyEnabled: trustedTypesDefaultPolicyEnabled,
|
||||
CSPReportOnlyEnabled: hs.Cfg.CSPReportOnlyEnabled,
|
||||
DateFormats: hs.Cfg.DateFormats,
|
||||
SecureSocksDSProxyEnabled: hs.Cfg.SecureSocksDSProxy.Enabled && hs.Cfg.SecureSocksDSProxy.ShowUI,
|
||||
EnableFrontendSandboxForPlugins: hs.Cfg.EnableFrontendSandboxForPlugins,
|
||||
PublicDashboardAccessToken: c.PublicDashboardAccessToken,
|
||||
PublicDashboardsEnabled: hs.Cfg.PublicDashboardsEnabled,
|
||||
CloudMigrationIsTarget: isCloudMigrationTarget,
|
||||
CloudMigrationFeedbackURL: hs.Cfg.CloudMigration.FeedbackURL,
|
||||
CloudMigrationPollIntervalMs: int(hs.Cfg.CloudMigration.FrontendPollInterval.Milliseconds()),
|
||||
SharedWithMeFolderUID: folder.SharedWithMeFolderUID,
|
||||
RootFolderUID: accesscontrol.GeneralFolderUID,
|
||||
LocalFileSystemAvailable: hs.Cfg.LocalFileSystemAvailable,
|
||||
ReportingStaticContext: hs.Cfg.ReportingStaticContext,
|
||||
ExploreDefaultTimeOffset: hs.Cfg.ExploreDefaultTimeOffset,
|
||||
ExploreHideLogsDownload: hs.Cfg.ExploreHideLogsDownload,
|
||||
|
||||
DefaultDatasourceManageAlertsUIToggle: hs.Cfg.DefaultDatasourceManageAlertsUIToggle,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user