Add a setting to allow DB queries

This commit is contained in:
ryan
2017-10-18 23:33:10 +02:00
parent c6ee715ef3
commit 4440133f4d
3 changed files with 15 additions and 2 deletions
+3 -1
View File
@@ -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");
}
}
}