mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:54:03 +00:00
Move Postgres user permissions to config
This commit is contained in:
parent
1ce18d2759
commit
0f9e0f33b0
3 changed files with 25 additions and 13 deletions
|
|
@ -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}\"");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue