Skip to content

Commit

Permalink
Merge pull request #94 from cerebruminc/lucianbuzzo/yates-prefix-cata…
Browse files Browse the repository at this point in the history
…log-queries

fix: only select role and policies that have a yates prefix
  • Loading branch information
LucianBuzzo authored Mar 26, 2024
2 parents 5b1cb0a + d60498a commit 2191f67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ services:
interval: 5s
timeout: 5s
retries: 5
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
# command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ export const createRoles = async <
const roles = getRoles(abilities as T);

const pgRoles: PgRole[] = await prisma.$queryRawUnsafe(`
select * from pg_catalog.pg_roles
`);
select * from pg_catalog.pg_roles where rolname like 'yates%'
`);
const pgPolicies: PgPolicy[] = await prisma.$queryRawUnsafe(`
select * from pg_catalog.pg_policies;
select * from pg_catalog.pg_policies where policyname like 'yates%'
`);

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

0 comments on commit 2191f67

Please sign in to comment.