# accessWhere() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.accesswhere/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 1.0.1 — generated reference, not hand-written

Compose the access-scope `where` clause for a single model.

**Signature:**

```typescript
export declare function accessWhere(where: Record<string, unknown> | undefined, config: Record<string, string[]> | undefined, resolvers: Record<string, AccessScopeResolver>): Record<string, unknown> | undefined;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| where | Record<string, unknown> \| undefined | The caller's own filter, or undefined. |
| config | Record<string, string\[\]> \| undefined | Scope columns per level for this one model, or undefined when the model is not scoped. |
| resolvers | Record<string, [AccessScopeResolver](https://imqueue.org/api/pg-prisma/latest/pg-prisma.accessscoperesolver/)> | One resolver per access level, keyed by level name. |


**Returns:**

Record<string, unknown> \| undefined

The combined filter, or `where` unchanged when the model is not scoped or no level is active — returned by identity, so callers can compare.

## Remarks

Each active level — one whose resolver returns anything other than `undefined` — contributes an OR across its columns, and the level filters are AND-ed together and AND-ed onto the caller's own `where`. Nothing is merged by key, so a caller cannot widen or override the scope by supplying a condition on a scope column.

This is the pure half of the mechanism, exported so the composition can be tested and reused directly; [accessScope()](https://imqueue.org/api/pg-prisma/latest/pg-prisma.accessscope/) is what applies it to queries.

