Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only select role and policies that have a yates prefix #94

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading