mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:14:03 +00:00
wip
This commit is contained in:
parent
562d507482
commit
034c284303
2 changed files with 4 additions and 2 deletions
|
|
@ -43,6 +43,8 @@ class CreateRLSPoliciesForTables
|
|||
)
|
||||
)");
|
||||
|
||||
dump(DB::select("select CURRENT_USER"));
|
||||
|
||||
DB::statement("ALTER TABLE {$table} FORCE ROW LEVEL SECURITY");
|
||||
|
||||
return Command::SUCCESS;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ test('postgres user can get deleted using the job', function() {
|
|||
expect($tenantHasPostgresUser())->toBeFalse();
|
||||
});
|
||||
|
||||
test('correct rls policies get created using the action or the command', function(bool $action) {
|
||||
test('correct rls policies get created', function(bool $action) {
|
||||
config([
|
||||
'tenancy.models.rls' => [
|
||||
Post::class, // Primary model (directly belongs to tenant)
|
||||
|
|
@ -94,4 +94,4 @@ test('correct rls policies get created using the action or the command', functio
|
|||
expect($getModelTables())->toContain($table->relname);
|
||||
expect($table->relforcerowsecurity)->toBeTrue();
|
||||
}
|
||||
})->with([true, false]);
|
||||
})->with(['action' => true, 'command' => false]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue