mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
make it possible to hide change password link in profile menu (#29246)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
parent
b75a7f0c96
commit
702cb90846
@ -30,11 +30,15 @@ func getProfileNode(c *models.ReqContext) *dtos.NavLink {
|
||||
{
|
||||
Text: "Preferences", Id: "profile-settings", Url: setting.AppSubUrl + "/profile", Icon: "sliders-v-alt",
|
||||
},
|
||||
{
|
||||
}
|
||||
|
||||
if setting.AddChangePasswordLink() {
|
||||
children = append(children, &dtos.NavLink{
|
||||
Text: "Change Password", Id: "change-password", Url: setting.AppSubUrl + "/profile/password",
|
||||
Icon: "lock", HideFromMenu: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if !setting.DisableSignoutMenu {
|
||||
// add sign out first
|
||||
children = append(children, &dtos.NavLink{
|
||||
|
@ -207,6 +207,12 @@ var (
|
||||
ImageUploadProvider string
|
||||
)
|
||||
|
||||
// AddChangePasswordLink returns if login form is disabled or not since
|
||||
// the same intention can be used to hide both features.
|
||||
func AddChangePasswordLink() bool {
|
||||
return !DisableLoginForm
|
||||
}
|
||||
|
||||
// TODO move all global vars to this struct
|
||||
type Cfg struct {
|
||||
Raw *ini.File
|
||||
|
Loading…
Reference in New Issue
Block a user