NavTree: Don't add license and stats page unless your a Grafana Admin (#56410)
This commit is contained in:
@@ -55,6 +55,10 @@ func ProvideService(cfg *setting.Cfg, hooksService *hooks.HooksService) *OSSLice
|
|||||||
HooksService: hooksService,
|
HooksService: hooksService,
|
||||||
}
|
}
|
||||||
l.HooksService.AddIndexDataHook(func(indexData *dtos.IndexViewData, req *models.ReqContext) {
|
l.HooksService.AddIndexDataHook(func(indexData *dtos.IndexViewData, req *models.ReqContext) {
|
||||||
|
if !req.IsGrafanaAdmin {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if adminNode := indexData.NavTree.FindById(navtree.NavIDAdmin); adminNode != nil {
|
if adminNode := indexData.NavTree.FindById(navtree.NavIDAdmin); adminNode != nil {
|
||||||
adminNode.Children = append(adminNode.Children, &navtree.NavLink{
|
adminNode.Children = append(adminNode.Children, &navtree.NavLink{
|
||||||
Text: "Stats and license",
|
Text: "Stats and license",
|
||||||
|
|||||||
Reference in New Issue
Block a user