mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 03:42:08 +08:00
Dashboards: hide playlist edit functionality from viewers and snapshots link from unauthenticated users (#28992)
* feat: hide snapshots menu item from viewers * feat(playlists): prevent viewers from creating/editing playlists * feat: prevent viewers seeing playlist nav link if no playlists * refactor(playlist): rename isViewer property to canEditPlaylists * revert(playlists): put back note if viewer and no playlists * refactor(snapshots): consider admin/editor permission in folders/dashboards for displaying menu item * feat(snapshots): only show snapshot nav item if user is signed in * fix(snapshots): revert snapshots to previous state if delete snapshot api error
This commit is contained in:
@ -164,7 +164,15 @@ func (hs *HTTPServer) getNavTree(c *models.ReqContext, hasEditPerm bool) ([]*dto
|
||||
{Text: "Divider", Divider: true, Id: "divider", HideFromTabs: true},
|
||||
{Text: "Manage", Id: "manage-dashboards", Url: setting.AppSubUrl + "/dashboards", Icon: "sitemap"},
|
||||
{Text: "Playlists", Id: "playlists", Url: setting.AppSubUrl + "/playlists", Icon: "presentation-play"},
|
||||
{Text: "Snapshots", Id: "snapshots", Url: setting.AppSubUrl + "/dashboard/snapshots", Icon: "camera"},
|
||||
}
|
||||
|
||||
if c.IsSignedIn {
|
||||
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{
|
||||
Text: "Snapshots",
|
||||
Id: "snapshots",
|
||||
Url: setting.AppSubUrl + "/dashboard/snapshots",
|
||||
Icon: "camera",
|
||||
})
|
||||
}
|
||||
|
||||
navTree = append(navTree, &dtos.NavLink{
|
||||
|
Reference in New Issue
Block a user