Commit 702cb908 by Carl Bergquist Committed by GitHub

make it possible to hide change password link in profile menu (#29246)


Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
parent b75a7f0c
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment