@happyvertical/smrt-users 0.51.12 → 0.51.14

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
@@ -642,6 +642,23 @@ PermissionResolver evaluates permissions in order, where each level can add or r
642
642
  Tenant-level inherited permissions are part of the effective permission set
643
643
  returned by `resolvePermissions()` and `SessionService.loadSessionContext()`.
644
644
 
645
+ ### Resource-scoped grants
646
+
647
+ Use `checkResourceOperationPermission()` where an application must restrict an
648
+ otherwise tenant-authorized operation to one exact resource. Pass the resource
649
+ tenant/type/id and an application-owned `verifyResource` callback. The guard
650
+ first requires the catalogued tenant permission, then requires an active exact
651
+ `ResourceGrant`; a grant for project A never matches project B. A resource deny
652
+ overrides a resource grant, while tenant and membership denies remain the
653
+ upstream gate. The verifier must load authoritative ownership and fail closed.
654
+
655
+ `ResourceGrantService` is the only public grant surface: generated REST and MCP
656
+ operations are disabled. Its caller supplies a catalogued administrative operation
657
+ for the bootstrap grant, avoiding a circular "already delegated" requirement.
658
+ Delegation requires a live, delegable parent owned by the actor and covering the
659
+ same tenant/resource/permission; chains are bounded and ancestor revocation
660
+ immediately invalidates every child at the next guard check.
661
+
645
662
  ### Hierarchical tenants
646
663
 
647
664
  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.