@happyvertical/smrt-users 0.56.1 → 0.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1138,6 +1138,27 @@ immediately invalidates every child at the next guard check.
1138
1138
 
1139
1139
  ### Hierarchical tenants
1140
1140
 
1141
+ `TenantCollection` is the only hierarchy traversal API. Use
1142
+ `getAncestorIds()`, `getDescendantIds()`, and `requireChildOf()` rather than
1143
+ walking `parentTenantId` in an application.
1144
+
1145
+ For a reviewed cross-tenant **list** read, use
1146
+ `withTenantCatalogReadScope()` for the active family, its ancestors, and
1147
+ global rows, or `withTenantHierarchyContext()` for one authorized root and its
1148
+ descendants. Both require an active tenant **and user**, a non-empty qualified
1149
+ collection allowlist, active `enableTenancy()` enforcement, and an authorizer
1150
+ that returns exactly `true`; every
1151
+ other result fails closed. The callback can widen only `list()` for those
1152
+ collections. `get()`, raw queries, saves, and deletes retain normal tenancy
1153
+ guards (tenant-scoped collection writes and raw queries are rejected while the
1154
+ scope is active). This is a trusted server API, not a sandbox: direct database
1155
+ executors and models without tenancy remain the host's responsibility. Catalog scopes never
1156
+ include descendants or siblings; subtree scopes never include ancestors or
1157
+ global rows. The actor and database session authority are unchanged. PostgreSQL
1158
+ RLS remains an additional restriction: effective visibility is the intersection
1159
+ of the approved scope and the database policies, so a stricter RLS policy may
1160
+ exclude ancestor or global rows even after application authorization.
1161
+
1141
1162
  Tenants support parent-child trees (max depth 10). Two flags control inheritance: `cascadePermissions` (parent pushes down) and `inheritPermissions` (child accepts). Both must be true for permissions to flow.
1142
1163
 
1143
1164
  The materialized `hierarchyPath` / `hierarchyLevel` are **derived by the