Snapshots: Allow user with viewer permissions to delete own snapshots (#58572)

Also allows deletion of snapshots whose original dashboard is
in a folder which the viewer has explicit edit permissions for
This commit is contained in:
kay delaney
2022-11-14 19:13:33 +00:00
committed by GitHub
parent 9855e74b92
commit 59d2cf2ff7

View File

@@ -684,5 +684,5 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/api/snapshot/shared-options/", reqSignedIn, GetSharingOptions)
r.Get("/api/snapshots/:key", routing.Wrap(hs.GetDashboardSnapshot))
r.Get("/api/snapshots-delete/:deleteKey", reqSnapshotPublicModeOrSignedIn, routing.Wrap(hs.DeleteDashboardSnapshotByDeleteKey))
r.Delete("/api/snapshots/:key", reqEditorRole, routing.Wrap(hs.DeleteDashboardSnapshot))
r.Delete("/api/snapshots/:key", reqSignedIn, routing.Wrap(hs.DeleteDashboardSnapshot))
}