Skip to content
Merged
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
Binary file not shown.
25 changes: 24 additions & 1 deletion fern/products/docs/pages/authentication/rbac.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ subtitle: Control who can view your documentation
description: Learn how to restrict access to your documentation using role-based access control (RBAC)
---


<Warning title="Team and Enterprise feature">
Password-based RBAC is available on the [Team and Enterprise plans](https://buildwithfern.com/pricing). JWT and OAuth-based RBAC require the [Enterprise plan](https://buildwithfern.com/pricing).
</Warning>
Expand Down Expand Up @@ -77,6 +76,30 @@ Use the `<If />` component to [conditionally render content](/learn/docs/writing

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

## Example

Fern's RBAC demo site defines the following roles:

```yml docs.yml
roles:
- everyone
- work-trial
- engineers
- contractors
```

Unauthenticated users can only access sections marked as `viewers: everyone`. After logging in, users with the `work-trial`, `engineers`, or `contractors` role can access work trial content, engineering documentation, and contractor information.

<Frame caption="The `docs.yml` defines roles and gates sections, then the [live site](https://engineering.ferndocs.com/rbac-demo/public-content/) shows the public view.">
<video
autoPlay
muted
loop
>
<source src="assets/rbac.mp4" type="video/mp4" />
</video>
</Frame>

<llms-only>
## Common errors

Expand Down
Loading