asUser
The user a call acts for.
with noclick.as_user(user): sets it for everything inside, sync or async:
.aio calls, tasks and asyncio.to_thread. A thread you start yourself
begins without it (a contextvars rule), so pass user= there. A
method's user= argument wins over it.
function asUser(user: UserRef | null, fn: () => T | Promise<T>): Promise<T>Run fn acting for user (null = the account). Nests; the inner scope wins.
currentUser
function currentUser(): UserRef | nullThe user set by the innermost asUser (or null).
Returns
What the innermost as_user was given, as given (nothing is looked up), or None
outside every as_user block, where calls act for your account.
ALL_USERS
const ALL_USERS: "all"Every user plus account-level rows, for a read's userFilter.
NO_USER
const NO_USER: "none"Account-level rows only (no user), for a read's userFilter.