Skip to main content

What are Resource Collections?

Resource Collections dynamically group resources based on match rules. Instead of manually adding resources to a group, you define criteria and any matching resources are automatically included. Collections are powerful for:
  • Applying policies to groups of resources
  • Querying resources by attributes
  • Building dynamic access control rules

Collection Properties

Supported match operators: fieldseq/ne/gt/gte/lt/lte/in/nin/contains/startsWith/endsWith/regex (plus bare-value equality, e.g. {"status": "active"}); timebefore/after/between (absolute ISO timestamps); patterns — matched as a regex (new RegExp), not a glob; plus tags, condition (json-logic), and the any/all/none combinators.

Match Definition

The match object defines how resources are matched:

Creating Collections

Match by Fields

Match by Tags

Match by Patterns

Match by Time

Match by JSON Logic Condition

Combining Match Rules

All (AND)

All conditions must match:

Any (OR)

Any condition can match:

None (NOT)

Exclude matching resources:

Complex Combinations

Using Collections with Policies

Collections are most powerful when combined with Resource Policies:

Querying Collections

Get Collections for a Scope

Get Collection by ID

Collection Matching at Evaluation Time

When evaluating permissions, the engine:
  1. Gets the resource being accessed
  2. Finds all collections in scope
  3. Evaluates each collection’s match definition against the resource
  4. Applies policies from matching collections

Best Practices

Complex nested rules are hard to debug. Use multiple collections if needed.
Collection names should clearly describe what resources are included.
Verify your match rules capture the intended resources before applying policies.
Very broad collections (matching many resources) may impact evaluation performance.
Collections have no description field—put the intent in the name.

Resource Policies

Apply access rules to collections

Tags

Tag resources for collection matching

Evaluation

How collections affect permission checks