公共 API 参考(@saas/contracts + @core/saas-kit + apps/api 对外接口)
    Preparing search index...

    当前请求租户作用域的读取器(ALS 支撑·单例免请求作用域化)。

    Accessor for the current request's tenant scope. Backed by AsyncLocalStorage so a singleton can read the per-request store without request-scoping every consumer (global-tenancy §9.3 / FR-2).

    S0 only exposes read access; the fail-closed enforcement guard (FR-5) lands in S2.

    Index
    • get role(): string | undefined

      Active tenant 内的成员角色(module-rbac-casl 丙裁·ALS 预注入)。undefined = 无活动租户/封禁/词汇外角色——AuthorizationGuard 据此 fail-closed。

      Returns string | undefined

    • get userId(): string | undefined

      当前会话用户 id(module-rbac-query-level-filtering 切片 C·ALS 预注入字段补读取面)。 undefined = 未解析出会话——listPredicate 的 {{userId}} 模板解析输入,缺省时 转换器留字面模板 = DB 匹配落空(保守 deny·与 check 级同向)。

      Returns string | undefined

    • get workspaceId(): string | undefined

      活动工作区 id(S3 · D2/§9.2);请求未携 x-workspace-id 选择器时为 undefined。 设计上为可选:它只在已受信租户内收窄读/写,本身从不作为独立安全边界。

      Returns string | undefined

    • fail-closed:要求存在活动租户,否则 403。用于租户作用域端点。

      Returns string

      活动租户 id;无则抛 ForbiddenException

      缺少活动租户上下文时(fail-closed)。