Skip to main content

Overview

Conditional permissions use JSON Logic to make dynamic authorization decisions based on subject attributes, resource attributes, tags, and context.
See the canonical Conditional Permissions page for the exact model. Two things this guide’s examples get wrong:
  1. Conditions attach to the role-permission edge (condition), not a logic field on a permission. A permission has no logic field—one placed there is silently ignored (the grant becomes unconditional).
  2. subject.tags.* matching is not enforced yet (the engine doesn’t load subject tags—see the roadmap). Resource-side tags, subject.meta.*, and the trusted-clock time.* do work today.

JSON Logic Basics

Bedrock uses JSON Logic for conditions. A condition on a role-permission edge (condition) must evaluate to true for that role to grant the permission.

Simple Comparison

Variable Access

Nested Properties

Available Variables

Common Operators

Comparison

Logical

Array Operations

Permission Examples

Department Match

Owner Access

Clearance Level

Business Hours Only

IP Allowlist

Active Employee

Multi-Factor Required

Complex Examples

Owner OR Manager OR Admin

Department Match AND Clearance AND Active

All Required Certifications

Passing Context

Include custom context in evaluations:

Debugging Conditions

The decision includes the evaluated context:

Best Practices

Complex nested conditions are hard to debug. Break into multiple permissions if needed.
Store data in well-named metadata fields for readable conditions.
Test with various combinations of subject/resource attributes.
Use the permission’s description field to explain what the condition does.
Very complex conditions evaluated frequently can impact performance.

Next Steps

Tag-Based Access

Tag-specific condition patterns

Row-Level Access

Resource-level permission patterns