@happyvertical/smrt-users 0.56.1 → 0.57.0
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 +21 -0
- package/dist/chunks/{TerminalAuthService-qeDjch8C.js → TerminalAuthService-CoJsfo1u.js} +72 -5
- package/dist/chunks/TerminalAuthService-CoJsfo1u.js.map +1 -0
- package/dist/collections/TenantCollection.d.ts +34 -0
- package/dist/collections/TenantCollection.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/manifest.json +399 -13
- package/dist/services/PermissionCatalogService.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +641 -4393
- package/dist/sveltekit.js +1 -1
- package/package.json +9 -9
- package/dist/chunks/TerminalAuthService-qeDjch8C.js.map +0 -1
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
|