Function: isWithin()
isWithin(
candidate,root):boolean
Defined in: packages/authz/src/tree-path.ts:49
Whether candidate is root or lies beneath it. Compared by whole segment:
/oktoid/smoke-2 is NOT within /oktoid/smoke, which a naive prefix test gets
wrong. Nothing is within a tenant root from /'s side: / is within only /.
Parameters
candidate
The path being tested.
root
The path it must lie within.
Returns
boolean
true when candidate equals root or is a descendant of it.