Do not show other databases if session is locked

Fixes: #470
This commit is contained in:
Simon Hanna 2020-07-15 18:11:05 +02:00 committed by GitHub
parent a5f9df34fb
commit 27a83bdf9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,6 +285,10 @@ func ExplainQuery(c *gin.Context) {
// GetDatabases renders a list of all databases on the server
func GetDatabases(c *gin.Context) {
if command.Opts.LockSession {
serveResult(c, []string{}, nil)
return
}
conn := DB(c)
if conn.External {
errorResponse(c, 403, errNotPermitted)