Decides whether contextUser may address an already-loaded session: the AuthorizeSessionAccess
decision, reading the session's conversation only when that decision needs it.
AuthorizeSessionAccess decides a principal without a scope identity — a named user with no magic-link
scope, the usual signed-in caller — from the owner check alone, and refuses a non-owner before it looks at
anything else, so neither needs the conversation read. This function and that one encode the same rule on
purpose and live together for that reason: change the rule there, change the read here. The
AuthorizeLoadedSession table test in sessionAccess.test.ts fails if the two ever disagree.
Decides whether
contextUsermay address an already-loadedsession: the AuthorizeSessionAccess decision, reading the session's conversation only when that decision needs it.AuthorizeSessionAccess decides a principal without a scope identity — a named user with no magic-link scope, the usual signed-in caller — from the owner check alone, and refuses a non-owner before it looks at anything else, so neither needs the conversation read. This function and that one encode the same rule on purpose and live together for that reason: change the rule there, change the read here. The
AuthorizeLoadedSessiontable test insessionAccess.test.tsfails if the two ever disagree.