Skip to content

Commit d60498a

Browse files
committed
fix: only select role and policies that have a yates prefix
1 parent 5b1cb0a commit d60498a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ services:
3434
interval: 5s
3535
timeout: 5s
3636
retries: 5
37-
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
37+
# command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@ export const createRoles = async <
403403
const roles = getRoles(abilities as T);
404404

405405
const pgRoles: PgRole[] = await prisma.$queryRawUnsafe(`
406-
select * from pg_catalog.pg_roles
407-
`);
406+
select * from pg_catalog.pg_roles where rolname like 'yates%'
407+
`);
408408
const pgPolicies: PgPolicy[] = await prisma.$queryRawUnsafe(`
409-
select * from pg_catalog.pg_policies;
409+
select * from pg_catalog.pg_policies where policyname like 'yates%'
410410
`);
411411

412412
// For each of the models and abilities, create a role and a corresponding RLS policy

0 commit comments

Comments
 (0)