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

    租户级 RBAC 守卫(对声明了 @Can 的路由裁决放行 / 403)。

    Enforces tenant-level RBAC for routes annotated with @Can (module-rbac-casl §2.2/§2.3 · global-tenancy §9.3 / FR-4). Applied per-route via @UseGuards.

    Fail-closed: without an active tenant context the request is rejected outright; a guarded route additionally requires the ALS-preset member role (丙裁·会话解析点预注入) — missing role denies. The allow/deny decision itself is delegated to the core-owned PermissionChecker port, whose reference-app adapter projects the tenant's DB grant rows (organization_role_grant·module-rbac-dynamic-roles) into a CASL ability. Core imports no auth / CASL impl (§9.5.4①B).

    Implements

    • CanActivate
    Index
    • 逐路由裁决:无活动租户即 fail-closed 抛 403;声明了 @Can 则交 PermissionChecker 判定。

      Parameters

      • context: ExecutionContext

        Nest 执行上下文(取 handler/class 元数据 + 租户会话)

      Returns Promise<boolean>

      放行返回 true;否则抛 ForbiddenException

      缺少所需权限(action + subject)时。