2022-02-10 17:47:48 +01:00
|
|
|
package resourcepermissions
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net/http"
|
|
|
|
|
|
2023-01-27 08:50:36 +01:00
|
|
|
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
2022-02-10 17:47:48 +01:00
|
|
|
"github.com/grafana/grafana/pkg/web"
|
|
|
|
|
)
|
|
|
|
|
|
2022-04-28 10:46:18 +02:00
|
|
|
func disableMiddleware(shouldDisable bool) web.Handler {
|
2023-01-27 08:50:36 +01:00
|
|
|
return func(c *contextmodel.ReqContext) {
|
2022-04-28 10:46:18 +02:00
|
|
|
if shouldDisable {
|
|
|
|
|
c.Resp.WriteHeader(http.StatusNotFound)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-02 13:19:14 +01:00
|
|
|
|
2023-01-27 08:50:36 +01:00
|
|
|
func nopMiddleware(c *contextmodel.ReqContext) {}
|