fix unauthed user case

This commit is contained in:
bkellam 2025-09-20 16:43:48 -07:00
parent 8a51fe7d23
commit a386364473

View file

@ -32,7 +32,8 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
args.where = { args.where = {
...args.where, ...args.where,
OR: [ OR: [
// Only include repos that are permitted to the user, // Only include repos that are permitted to the user
...(userId ? [
{ {
permittedUsers: { permittedUsers: {
some: { some: {
@ -40,6 +41,7 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
} }
} }
}, },
] : []),
// or are public. // or are public.
{ {
isPublic: true, isPublic: true,