Playlists: Remove from menu for users without permissions (#94403)

This commit is contained in:
Ezequiel Victorero 2024-10-08 13:04:18 -03:00 committed by GitHub
parent e1067b817d
commit 19844220db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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",