Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fern/products/docs/pages/authentication/rbac.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ Use the `<If />` component to [conditionally render content](/learn/docs/writing

You can also combine `roles` with `products` and `versions` props.

## Preview as a role

On a docs [preview link](/learn/docs/preview-publish/preview-changes#preview-links), a role selector lets you view the site as a specific viewer to verify role-based visibility before publishing. Pick one or more roles to see the site as a user with those roles, or select anonymous to see the public view. The docs re-render with that viewer's visibility applied, including nav pruning, `<If />` blocks, and role-gated tabs and products. With no selection, the preview shows all content regardless of role.

## Example

Fern's RBAC demo site defines the following roles:
Expand Down
7 changes: 7 additions & 0 deletions fern/products/docs/pages/changelog/2026-07-15.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Preview docs as a role

<ChangelogTags>security</ChangelogTags>

Teams can now preview a role-gated docs site as a specific viewer to validate their gating before publishing. On a preview link, a role selector lets you pick one or more roles (or anonymous) and re-renders the site with that viewer's role-based visibility applied, including nav pruning, `<If />` blocks, and role-gated tabs and products. With no selection, the preview continues to show all content.

<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/authentication/features/rbac#preview-as-a-role">Read the docs</Button>
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ fern generate --docs --preview --id my-feature
```
</Info>

If your docs use [role-based access control](/learn/docs/authentication/features/rbac#preview-as-a-role), a role selector on the preview link lets you view the site as a specific viewer and verify role-gated visibility before publishing.

### Manage preview links

Preview links persist indefinitely — Fern doesn't auto-expire them. Any organization member can use [`fern docs preview list`](/learn/cli-api-reference/cli-reference/commands#fern-docs-preview-list) to see active previews and [`fern docs preview delete`](/learn/cli-api-reference/cli-reference/commands#fern-docs-preview-delete) to remove them when they're no longer needed. To clean up previews automatically when PRs merge, set up a [GitHub Actions workflow](#clean-up-preview-links-when-prs-merge).
Expand Down
Loading