mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 18:13:32 -06:00
18 lines
310 B
Go
18 lines
310 B
Go
package resourcepermissions
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/grafana/grafana/pkg/web"
|
|
)
|
|
|
|
func disableMiddleware(shouldDisable bool) web.Handler {
|
|
return func(c *models.ReqContext) {
|
|
if shouldDisable {
|
|
c.Resp.WriteHeader(http.StatusNotFound)
|
|
return
|
|
}
|
|
}
|
|
}
|