From 19844220db28e55c9c5e61730b6df036bc2b7cf9 Mon Sep 17 00:00:00 2001 From: Ezequiel Victorero Date: Tue, 8 Oct 2024 13:04:18 -0300 Subject: [PATCH] Playlists: Remove from menu for users without permissions (#94403) --- pkg/services/navtree/navtreeimpl/navtree.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index d89454d5ee0..e4bdfcf2bfc 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -355,11 +355,13 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt dashboardChildNavs := []*navtree.NavLink{} - dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{ - Text: "Playlists", SubTitle: "Groups of dashboards that are displayed in a sequence", Id: "dashboards/playlists", Url: s.cfg.AppSubURL + "/playlists", Icon: "presentation-play", - }) - if c.IsSignedIn { + if c.SignedInUser.HasRole(org.RoleViewer) { + dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{ + Text: "Playlists", SubTitle: "Groups of dashboards that are displayed in a sequence", Id: "dashboards/playlists", Url: s.cfg.AppSubURL + "/playlists", Icon: "presentation-play", + }) + } + if s.cfg.SnapshotEnabled { dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{ Text: "Snapshots",