mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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,
|
||||
}
|
||||
l.HooksService.AddIndexDataHook(func(indexData *dtos.IndexViewData, req *models.ReqContext) {
|
||||
if !req.IsGrafanaAdmin {
|
||||
return
|
||||
}
|
||||
|
||||
if adminNode := indexData.NavTree.FindById(navtree.NavIDAdmin); adminNode != nil {
|
||||
adminNode.Children = append(adminNode.Children, &navtree.NavLink{
|
||||
Text: "Stats and license",
|
||||
|
||||
Reference in New Issue
Block a user