Commit 962f9967 by Marcus Efraimsson

always show server admin link in sidenav if grafana admin

parent 58406707
...@@ -233,7 +233,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) { ...@@ -233,7 +233,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
} }
} }
if c.OrgRole == m.ROLE_ADMIN { if c.IsGrafanaAdmin || c.OrgRole == m.ROLE_ADMIN {
cfgNode := &dtos.NavLink{ cfgNode := &dtos.NavLink{
Id: "cfg", Id: "cfg",
Text: "Configuration", Text: "Configuration",
...@@ -287,10 +287,24 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) { ...@@ -287,10 +287,24 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
}, },
} }
if c.IsGrafanaAdmin { if c.OrgRole != m.ROLE_ADMIN {
cfgNode = &dtos.NavLink{
Id: "cfg",
Text: "Configuration",
SubTitle: "Organization: " + c.OrgName,
Icon: "gicon gicon-cog",
Url: setting.AppSubUrl + "/admin/users",
Children: make([]*dtos.NavLink, 0),
}
}
if c.OrgRole == m.ROLE_ADMIN && c.IsGrafanaAdmin {
cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{ cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{
Divider: true, HideFromTabs: true, Id: "admin-divider", Text: "Text", Divider: true, HideFromTabs: true, Id: "admin-divider", Text: "Text",
}) })
}
if c.IsGrafanaAdmin {
cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{ cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{
Text: "Server Admin", Text: "Server Admin",
HideFromTabs: true, HideFromTabs: true,
......
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