Overview
Conditional permissions use JSON Logic to make dynamic authorization decisions based on subject attributes, resource attributes, tags, and context. This enables attribute-based access control (ABAC) beyond simple role assignments.JSON Logic Basics
Bedrock uses JSON Logic for permission conditions. Thelogic field on a permission contains a JSON Logic expression that must evaluate to true for the permission to apply.
Simple Comparison
Variable Access
Nested Properties
Available Variables
| Variable | Description |
|---|---|
subject.id | Subject’s Bedrock ID |
subject.type | Subject type (user, agent, etc.) |
subject.externalId | External system ID |
subject.meta.* | Subject metadata fields |
subject.tags.* | Subject’s tags by group key |
resource.id | Resource’s Bedrock ID |
resource.type | Resource type key |
resource.scopeId | Resource’s owning scope |
resource.externalResourceId | External resource ID |
resource.meta.* | Resource metadata |
resource.tags.* | Resource’s tags by group key |
context.* | Custom context passed in evaluation |
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
Keep conditions simple
Keep conditions simple
Complex nested conditions are hard to debug. Break into multiple permissions if needed.
Use meaningful variable names
Use meaningful variable names
Store data in well-named metadata fields for readable conditions.
Test thoroughly
Test thoroughly
Test with various combinations of subject/resource attributes.
Document conditions
Document conditions
Use the permission’s
description field to explain what the condition does.Consider performance
Consider performance
Very complex conditions evaluated frequently can impact performance.