DocsPermissions & hooks · FRL
On this page

Protect private data and edits

Combine read visibility with safe update rules.

Before you begin: Apply ownership rules.

Mixed Public and Private Reads

A production theme often needs public reads for published content and private reads for drafts.

frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

Use $post.current for trusted saved values and $post.pending for values being written. For stored ownership checks during edit and delete, $post.current.data or $post.current is the safe side because it cannot be changed by the incoming request.

Protecting Update Merge Behavior

When the frontend calls Frontbacked.updatePost, Frontbacked may merge the submitted patch into the previous post before validating the final result. That is convenient, but it means your rule must protect fields that should not change.

Use all three together:

  1. Strict schemas reject fields that do not belong to the post type.
  2. immutable protects fields that must never change.
  3. editableIf protects fields that can change only under an explicit guard.
frl

Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →

This prevents a site from using a partial update to change ownership, site identity, or protected workflow state.

Common Mistakes

Avoid using frontend-only assumptions as security. Hidden inputs, disabled buttons, and JavaScript checks improve UX, but FRL is what protects saved data.

Avoid trusting mutable fields for ownership. During edit and delete, use $post.current instead of $post.pending.

Avoid broad edit rules on public content. If public users can edit, tie the rule to a signed-in user and immutable owner fields.