From 824cc0af1ef91394c98d405d672f63e425d375d5 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 21 Apr 2019 14:50:31 -0300 Subject: [PATCH] Bugfix: user is not allowed The created user don't has permission to connect to database. I changed the code to give permission Signed-off-by: Vitor Mattos --- lib/private/Setup/PostgreSQL.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index 283ab5f925..23c5ec7392 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -154,6 +154,8 @@ class PostgreSQL extends AbstractDatabase { // create the user $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); $query->execute(); + $query = $connection->prepare('GRANT CONNECT ON DATABASE ' . $this->dbName . ' TO '.addslashes($this->dbUser)); + $query->execute(); } catch (DatabaseException $e) { $this->logger->error('Error while trying to create database user'); $this->logger->logException($e);