1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 16:24:03 +00:00

Quote database parameter in GRANT statement for consistency

The database name is always quoted in statements (without binding) now.
This commit is contained in:
lukinovec 2026-04-30 16:14:06 +02:00
parent 37a4c7dd27
commit 2bd3a868ec

View file

@ -25,7 +25,7 @@ class PermissionControlledPostgreSQLSchemaManager extends PostgreSQLSchemaManage
$this->validateParameter([$username, $schema, $database]); $this->validateParameter([$username, $schema, $database]);
$this->connection()->statement("GRANT CONNECT ON DATABASE {$database} TO \"{$username}\""); $this->connection()->statement("GRANT CONNECT ON DATABASE \"{$database}\" TO \"{$username}\"");
$this->connection()->statement("GRANT USAGE, CREATE ON SCHEMA \"{$schema}\" TO \"{$username}\""); $this->connection()->statement("GRANT USAGE, CREATE ON SCHEMA \"{$schema}\" TO \"{$username}\"");
$this->connection()->statement("GRANT USAGE ON ALL SEQUENCES IN SCHEMA \"{$schema}\" TO \"{$username}\""); $this->connection()->statement("GRANT USAGE ON ALL SEQUENCES IN SCHEMA \"{$schema}\" TO \"{$username}\"");