From 9300ae7ce632fe7155b5aecc0ce5cf541bcd53da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 6 Oct 2022 14:30:51 +0200 Subject: [PATCH] NavTree: Don't add license and stats page unless your a Grafana Admin (#56410) --- pkg/services/licensing/oss.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/licensing/oss.go b/pkg/services/licensing/oss.go index ae47a21191b..821d05294a6 100644 --- a/pkg/services/licensing/oss.go +++ b/pkg/services/licensing/oss.go @@ -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",