mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 06:04: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");
|
DB::statement("ALTER TABLE {$table} FORCE ROW LEVEL SECURITY");
|
||||||
|
|
||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ test('postgres user can get deleted using the job', function() {
|
||||||
expect($tenantHasPostgresUser())->toBeFalse();
|
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([
|
config([
|
||||||
'tenancy.models.rls' => [
|
'tenancy.models.rls' => [
|
||||||
Post::class, // Primary model (directly belongs to tenant)
|
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($getModelTables())->toContain($table->relname);
|
||||||
expect($table->relforcerowsecurity)->toBeTrue();
|
expect($table->relforcerowsecurity)->toBeTrue();
|
||||||
}
|
}
|
||||||
})->with([true, false]);
|
})->with(['action' => true, 'command' => false]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue