mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 04:02:08 +08:00
Api: Readonly datasources should not be created via the API (#19006)
* Readonly datasources should not be created via the API * Return correct `ReadOnly` value in GetDataSourceByName
This commit is contained in:

committed by
GitHub

parent
359404eb77
commit
b5f0a5d5ca
@ -231,7 +231,6 @@ func GetDataSourceByName(c *m.ReqContext) Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dtos := convertModelToDtos(query.Result)
|
dtos := convertModelToDtos(query.Result)
|
||||||
dtos.ReadOnly = true
|
|
||||||
return JSON(200, &dtos)
|
return JSON(200, &dtos)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,9 +144,9 @@ type AddDataSourceCommand struct {
|
|||||||
IsDefault bool `json:"isDefault"`
|
IsDefault bool `json:"isDefault"`
|
||||||
JsonData *simplejson.Json `json:"jsonData"`
|
JsonData *simplejson.Json `json:"jsonData"`
|
||||||
SecureJsonData map[string]string `json:"secureJsonData"`
|
SecureJsonData map[string]string `json:"secureJsonData"`
|
||||||
ReadOnly bool `json:"readOnly"`
|
|
||||||
|
|
||||||
OrgId int64 `json:"-"`
|
OrgId int64 `json:"-"`
|
||||||
|
ReadOnly bool `json:"-"`
|
||||||
|
|
||||||
Result *DataSource
|
Result *DataSource
|
||||||
}
|
}
|
||||||
@ -168,10 +168,10 @@ type UpdateDataSourceCommand struct {
|
|||||||
JsonData *simplejson.Json `json:"jsonData"`
|
JsonData *simplejson.Json `json:"jsonData"`
|
||||||
SecureJsonData map[string]string `json:"secureJsonData"`
|
SecureJsonData map[string]string `json:"secureJsonData"`
|
||||||
Version int `json:"version"`
|
Version int `json:"version"`
|
||||||
ReadOnly bool `json:"readOnly"`
|
|
||||||
|
|
||||||
OrgId int64 `json:"-"`
|
OrgId int64 `json:"-"`
|
||||||
Id int64 `json:"-"`
|
Id int64 `json:"-"`
|
||||||
|
ReadOnly bool `json:"-"`
|
||||||
|
|
||||||
Result *DataSource
|
Result *DataSource
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user