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 <vitor@php.rio>
This commit is contained in:
parent
49829482c8
commit
824cc0af1e
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue