1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 20:54:03 +00:00

Move Postgres user permissions to config

This commit is contained in:
lukinovec 2023-06-15 13:03:44 +02:00
parent 1ce18d2759
commit 0f9e0f33b0
3 changed files with 25 additions and 13 deletions

View file

@ -17,8 +17,6 @@ class CreatePostgresUserForTenant implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public static array $permissions = ['ALL'];
/**
* Create a new job instance.
*
@ -59,7 +57,7 @@ class CreatePostgresUserForTenant implements ShouldQueue
foreach ($tenantModels as $model) {
$table = $model->getTable();
foreach (static::$permissions as $permission) {
foreach (config('tenancy.rls.user_permissions') as $permission) {
$databaseManager->database()->statement("GRANT {$permission} ON {$table} TO \"{$userName}\"");
}