mirror of
https://github.com/grafana/grafana.git
synced 2026-08-09 04:38:16 -05:00
Add a setting to allow DB queries
This commit is contained in:
@@ -166,7 +166,9 @@ func (proxy *DataSourceProxy) getDirector() func(req *http.Request) {
|
||||
func (proxy *DataSourceProxy) validateRequest() error {
|
||||
if proxy.ds.Type == m.DS_INFLUXDB {
|
||||
if proxy.ctx.Query("db") != proxy.ds.Database {
|
||||
return errors.New("Datasource is not configured to allow this database")
|
||||
if(!proxy.ds.JsonData.Get("allowDatabaseQuery").MustBool(false)) {
|
||||
return errors.New("Datasource is not configured to allow this database");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user