From b90b635f909a9902b1ef76f2bb35ab2a62f79fc2 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 28 Apr 2023 14:23:22 +0200 Subject: [PATCH] Add todos --- src/Jobs/CreatePostgresUserForTenant.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Jobs/CreatePostgresUserForTenant.php b/src/Jobs/CreatePostgresUserForTenant.php index ebe87dc9..13402477 100644 --- a/src/Jobs/CreatePostgresUserForTenant.php +++ b/src/Jobs/CreatePostgresUserForTenant.php @@ -38,6 +38,8 @@ class CreatePostgresUserForTenant implements ShouldQueue $password = $this->tenant->database()->getPassword() ?? 'password'; // Create the user only if it doesn't already exist + // todo1 Create permissions for the user (e.g. permission to create records) + // todo1 Switch to the Postgres user on TenancyInitialized (purge central DB connection, change credentials in database.connections.pgsql, change database.connections.central to the pgsql connection) if (! count(DB::select("SELECT usename FROM pg_user WHERE usename = '$name';")) > 0) { DB::statement("CREATE USER \"$name\" LOGIN PASSWORD '$password';"); }