Role-based access control
Control who can view your documentation
Configuring RBAC is part of the pro plan.
Fern allows you to restrict parts of your navigation to individuals with specific roles. Below, we walk through each of the steps required to configure RBAC.
Define all the roles in your docs.yml
Start by defining all the different roles in your docs.yml
. You can simply specify thise under a roles
key:
docs.yml
The
everyone
role is a special role. Every user has this role.Configure authentication via a FERN_TOKEN
In this step, we will configure authentication so that Fern can understand what roles a particular user has. Fern expects the user’s
browser session to have a cookie called FERN_TOKEN
. If the cookie is not present, the user will be redirected to your company’s
login page.
Upon login, you must set a JWT for the user using a secret key that we will provide you with. The JWT must have a fern
claim
with a key called roles.
Please reach out to support@buildwithfern.com when you are on this step so we can provide you with a secret key.