Skip to content

Commit 1157db1

Browse files
authored
Bugfix: user is not allowed
The created user don't has permission to connect to database. I changed the code to give permission
1 parent 4982948 commit 1157db1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/private/Setup/PostgreSQL.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ private function createDBUser(IDBConnection $connection) {
154154
// create the user
155155
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
156156
$query->execute();
157+
$query = $connection->prepare('GRANT CONNECT ON DATABASE ' . $this->dbName . ' TO '.addslashes($this->dbUser));
158+
$query->execute();
157159
} catch (DatabaseException $e) {
158160
$this->logger->error('Error while trying to create database user');
159161
$this->logger->logException($e);

0 commit comments

Comments
 (0)