mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
fix unauthed user case
This commit is contained in:
parent
8a51fe7d23
commit
a386364473
1 changed files with 9 additions and 7 deletions
|
|
@ -32,14 +32,16 @@ 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: {
|
{
|
||||||
some: {
|
permittedUsers: {
|
||||||
userId,
|
some: {
|
||||||
|
userId,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
] : []),
|
||||||
// or are public.
|
// or are public.
|
||||||
{
|
{
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue