mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Chore: Move ReqContext to contexthandler service * Rename package to contextmodel * Generate ngalert files * Remove unused imports
20 lines
403 B
Go
20 lines
403 B
Go
package resourcepermissions
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
|
"github.com/grafana/grafana/pkg/web"
|
|
)
|
|
|
|
func disableMiddleware(shouldDisable bool) web.Handler {
|
|
return func(c *contextmodel.ReqContext) {
|
|
if shouldDisable {
|
|
c.Resp.WriteHeader(http.StatusNotFound)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
func nopMiddleware(c *contextmodel.ReqContext) {}
|