Skip to main content
The Collection Rules service allows you to define access rules and field-level permissions for collections. This service works with the Roles service to provide fine-grained access control.

Overview

Collection rule management requires superadmin authentication.

Get Collection Rules

Get the access rules and field permissions for a specific collection:
The response includes:

Update Collection Rules

Update the access rules and field permissions for a collection:

Validate a Rule

Validate a rule expression before using it:
The response indicates if the rule is valid and any issues:

Test a Rule

Test how a rule evaluates with a specific context:
The response shows the evaluation result:

Rule Structure

Rules are defined with the following structure:

Field Permissions

Field-level permissions control read/write access to specific fields:

Common Patterns

Ownership-Based Access

Allow users to only access their own records:

Role-Based Access

Allow access based on user roles:

Group Membership

Allow access based on group membership:

Field-Level Privacy

Restrict sensitive fields to admins:

Complete Example

Collection rules editor:

Next Steps