mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Configurable signout menu activation (#7968)
This commit is contained in:
parent
ac39ed4218
commit
319b8d8fca
@ -205,6 +205,9 @@ default_theme = dark
|
|||||||
# Set to true to disable (hide) the login form, useful if you use OAuth
|
# Set to true to disable (hide) the login form, useful if you use OAuth
|
||||||
disable_login_form = false
|
disable_login_form = false
|
||||||
|
|
||||||
|
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy
|
||||||
|
disable_signout_menu = false
|
||||||
|
|
||||||
#################################### Anonymous Auth ######################
|
#################################### Anonymous Auth ######################
|
||||||
[auth.anonymous]
|
[auth.anonymous]
|
||||||
# enable anonymous access
|
# enable anonymous access
|
||||||
|
@ -192,6 +192,9 @@
|
|||||||
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
|
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
|
||||||
;disable_login_form = false
|
;disable_login_form = false
|
||||||
|
|
||||||
|
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
|
||||||
|
;disable_signout_menu = false
|
||||||
|
|
||||||
#################################### Anonymous Auth ##########################
|
#################################### Anonymous Auth ##########################
|
||||||
[auth.anonymous]
|
[auth.anonymous]
|
||||||
# enable anonymous access
|
# enable anonymous access
|
||||||
|
@ -267,6 +267,10 @@ options are `Admin` and `Editor` and `Read Only Editor`. e.g. :
|
|||||||
|
|
||||||
Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false.
|
Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false.
|
||||||
|
|
||||||
|
### disable_signout_menu
|
||||||
|
|
||||||
|
Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false.
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
## [auth.anonymous]
|
## [auth.anonymous]
|
||||||
|
@ -133,16 +133,17 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsonObj := map[string]interface{}{
|
jsonObj := map[string]interface{}{
|
||||||
"defaultDatasource": defaultDatasource,
|
"defaultDatasource": defaultDatasource,
|
||||||
"datasources": datasources,
|
"datasources": datasources,
|
||||||
"panels": panels,
|
"panels": panels,
|
||||||
"appSubUrl": setting.AppSubUrl,
|
"appSubUrl": setting.AppSubUrl,
|
||||||
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
|
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
|
||||||
"authProxyEnabled": setting.AuthProxyEnabled,
|
"authProxyEnabled": setting.AuthProxyEnabled,
|
||||||
"ldapEnabled": setting.LdapEnabled,
|
"ldapEnabled": setting.LdapEnabled,
|
||||||
"alertingEnabled": setting.AlertingEnabled,
|
"alertingEnabled": setting.AlertingEnabled,
|
||||||
"googleAnalyticsId": setting.GoogleAnalyticsId,
|
"googleAnalyticsId": setting.GoogleAnalyticsId,
|
||||||
"disableLoginForm": setting.DisableLoginForm,
|
"disableLoginForm": setting.DisableLoginForm,
|
||||||
|
"disableSignoutMenu": setting.DisableSignoutMenu,
|
||||||
"buildInfo": map[string]interface{}{
|
"buildInfo": map[string]interface{}{
|
||||||
"version": setting.BuildVersion,
|
"version": setting.BuildVersion,
|
||||||
"commit": setting.BuildCommit,
|
"commit": setting.BuildCommit,
|
||||||
|
@ -96,6 +96,7 @@ var (
|
|||||||
LoginHint string
|
LoginHint string
|
||||||
DefaultTheme string
|
DefaultTheme string
|
||||||
DisableLoginForm bool
|
DisableLoginForm bool
|
||||||
|
DisableSignoutMenu bool
|
||||||
|
|
||||||
// Http auth
|
// Http auth
|
||||||
AdminUser string
|
AdminUser string
|
||||||
@ -528,6 +529,7 @@ func NewConfigContext(args *CommandLineArgs) error {
|
|||||||
// auth
|
// auth
|
||||||
auth := Cfg.Section("auth")
|
auth := Cfg.Section("auth")
|
||||||
DisableLoginForm = auth.Key("disable_login_form").MustBool(false)
|
DisableLoginForm = auth.Key("disable_login_form").MustBool(false)
|
||||||
|
DisableSignoutMenu = auth.Key("disable_signout_menu").MustBool(false)
|
||||||
|
|
||||||
// anonymous access
|
// anonymous access
|
||||||
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
|
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
|
||||||
|
@ -23,7 +23,7 @@ export class SideMenuCtrl {
|
|||||||
this.isSignedIn = contextSrv.isSignedIn;
|
this.isSignedIn = contextSrv.isSignedIn;
|
||||||
this.user = contextSrv.user;
|
this.user = contextSrv.user;
|
||||||
this.appSubUrl = config.appSubUrl;
|
this.appSubUrl = config.appSubUrl;
|
||||||
this.showSignout = this.contextSrv.isSignedIn && !config['authProxyEnabled'];
|
this.showSignout = this.contextSrv.isSignedIn && !config['disableSignoutMenu'];
|
||||||
this.maxShownOrgs = 10;
|
this.maxShownOrgs = 10;
|
||||||
|
|
||||||
this.mainLinks = config.bootData.mainNavLinks;
|
this.mainLinks = config.bootData.mainNavLinks;
|
||||||
|
Loading…
Reference in New Issue
Block a user