mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
4ce0a49eac
* AlertingNG: Split into several packages * Move AlertQuery to models
24 lines
547 B
Go
24 lines
547 B
Go
package api
|
|
|
|
import (
|
|
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
func (api *API) validateOrgAlertDefinition(c *models.ReqContext) {
|
|
uid := c.ParamsEscape(":alertDefinitionUID")
|
|
|
|
if uid == "" {
|
|
c.JsonApiErr(403, "Permission denied", nil)
|
|
return
|
|
}
|
|
|
|
query := ngmodels.GetAlertDefinitionByUIDQuery{UID: uid, OrgID: c.SignedInUser.OrgId}
|
|
|
|
if err := api.Store.GetAlertDefinitionByUID(&query); err != nil {
|
|
c.JsonApiErr(404, "Alert definition not found", nil)
|
|
return
|
|
}
|
|
}
|