Skip to content

Commit

Permalink
Bugfix: user is not allowed
Browse files Browse the repository at this point in the history
The created user don't has permission to connect to database. I changed the code to give permission
  • Loading branch information
vitormattos authored Apr 21, 2019
1 parent 4982948 commit 1157db1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/private/Setup/PostgreSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ private function createDBUser(IDBConnection $connection) {
// 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);
Expand Down

0 comments on commit 1157db1

Please sign in to comment.