mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Snapshots: Viewers can not create a Snapshot (#84952)
This commit is contained in:
committed by
GitHub
parent
629a8808e0
commit
c57c033522
@@ -269,6 +269,13 @@ func (b *SnapshotsAPIBuilder) GetAPIRoutes() *builder.APIRoutes {
|
||||
fmt.Sprintf("user orgId does not match namespace (%d != %d)", info.OrgID, user.OrgID), nil)
|
||||
return
|
||||
}
|
||||
|
||||
cmd := dashboardsnapshots.CreateDashboardSnapshotCommand{}
|
||||
if err := web.Bind(wrap.Req, &cmd); err != nil {
|
||||
wrap.JsonApiErr(http.StatusBadRequest, "bad request data", err)
|
||||
return
|
||||
}
|
||||
|
||||
opts, err := b.options(info.Value)
|
||||
if err != nil {
|
||||
wrap.JsonApiErr(http.StatusBadRequest, "error getting options", err)
|
||||
@@ -276,7 +283,7 @@ func (b *SnapshotsAPIBuilder) GetAPIRoutes() *builder.APIRoutes {
|
||||
}
|
||||
|
||||
// Use the existing snapshot service
|
||||
dashboardsnapshots.CreateDashboardSnapshot(wrap, opts.Spec, b.service)
|
||||
dashboardsnapshots.CreateDashboardSnapshot(wrap, opts.Spec, cmd, b.service)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user