From 27a83bdf9e7879761ae50d8a325dce2757352d3b Mon Sep 17 00:00:00 2001 From: Simon Hanna <33220646+simhnna@users.noreply.github.com> Date: Wed, 15 Jul 2020 18:11:05 +0200 Subject: [PATCH] Do not show other databases if session is locked Fixes: #470 --- pkg/api/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/api/api.go b/pkg/api/api.go index 6a8fdaa..be8f44c 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -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)