Skip to main content

What are Resource Hierarchies?

Resource hierarchies allow you to model parent-child relationships between resources. A folder contains documents, a project contains tasks, an order contains line items. These relationships enable hierarchical permission propagation and structured queries.

Hierarchy Edge Properties

Cascade Modes

The cascade property controls how permissions propagate through the hierarchy:

Inherit

A permission patterned to a parent resource can grant access to that resource’s descendants:
With cascade: "inherit", when a child resource is evaluated and direct RBAC denies, the engine walks up the inherit edges to the child’s ancestors. Access is granted if the subject holds a permission whose resourceType matches the child’s type (or *) and whose resourcePattern is an ancestor’s resource id.
This is not “folder-read permission implies document-read”. The granting permission must be typed to the child (or *) and patterned to the ancestor’s id—e.g. a document-typed (or *) read permission with resourcePattern: "resource_folder_123" grants read on documents beneath that folder. A permission typed folder does not satisfy a document evaluation.

None

No permission inheritance—child resources require explicit access:
With cascade: "none":
  • Parent access does not grant child access
  • Each resource requires its own permissions
  • Ideal for references, links, dependencies

Creating Resource Hierarchies

Resource Type Hierarchies

Before creating resource hierarchies, define which resource types can contain which:

Hierarchical Permission Patterns

Pattern 1: Grant Access to a Folder’s Contents

Grant read on everything beneath a folder by patterning a permission to the folder’s id (typed to the child, or *). The engine applies it automatically when a document inside is evaluated:

Pattern 2: Nested Inheritance

Inheritance walks the full ancestor chain, so a permission patterned to a top-level container reaches everything beneath it (as long as the edges are cascade: "inherit"):
Inheritance is driven by the ancestor resourcePattern, not a condition. There is no resource.parentId or subject.accessibleFolders in the condition context—don’t model hierarchy access with a logic condition.

Common Hierarchy Patterns

Document Management

Project Management

E-Commerce

Construction

Querying Hierarchies

Relationship Types

Use relationshipType to distinguish different kinds of relationships:

Best Practices

Always define resource type hierarchies before creating resource instance hierarchies.
Choose relationship types that reflect your domain model.
Very deep hierarchies can impact query performance. Consider flattening when possible.
Plan how permissions will propagate through your hierarchy before building it.

Ancestor Traversal

When evaluating permissions with cascade: "inherit", the engine traverses ancestors:
Response:
The evaluation engine checks permissions on each ancestor until access is granted or all ancestors are exhausted.

Next Steps

Resource Scope Links

Associate resources with multiple scopes

Resource Policies

Fine-grained access control on resources