enforce permitted user check even when no where clause
Some checks are pending
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Waiting to run
Publish to ghcr / merge (push) Blocked by required conditions

This commit is contained in:
msukkari 2025-10-26 21:11:42 -07:00
parent 0bd545359e
commit b939d1e420

View file

@ -27,10 +27,11 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
query: { query: {
...(env.EXPERIMENT_EE_PERMISSION_SYNC_ENABLED === 'true' && hasEntitlement('permission-syncing') ? { ...(env.EXPERIMENT_EE_PERMISSION_SYNC_ENABLED === 'true' && hasEntitlement('permission-syncing') ? {
repo: { repo: {
$allOperations({ args, query }) { async $allOperations({ args, query }) {
if ('where' in args) { // eslint-disable-next-line @typescript-eslint/no-explicit-any
args.where = { const argsWithWhere = args as any;
...args.where, argsWithWhere.where = {
...(argsWithWhere.where || {}),
OR: [ OR: [
// Only include repos that are permitted to the user // Only include repos that are permitted to the user
...(userId ? [ ...(userId ? [
@ -48,7 +49,6 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
} }
] ]
} }
}
return query(args); return query(args);
} }