Skip to content

OwnerCheck

OwnerCheck = (key, user, env) => Promise<boolean> | boolean

Defined in: packages/storage/src/types.ts:109

Access-control gate evaluated by the opinionated /uploads/* proxy route before streaming a private R2 object. Return true to allow access, false to respond with HTTP 403.

string

The R2 object key being requested (from params["*"]).

The authenticated user returned by requireUser, or null if the route was configured without a requireUser callback.

{[k: string]: unknown; id: string; } | null

Record<string, unknown>

The Workers environment, so the implementation can reach its database bindings.

Promise<boolean> | boolean