> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJkZTRkZDBhNy0yYzM5LTQ1MjktODI0MC1mZGI1MDE0M2VhNzQiLCJleHAiOjE3NzgyOTA5NTAsImlhdCI6MTc3ODI5MDY1MH0.lZ_MoasT6fLVP9oV8PvwgeXYZkftBK6QKuyeM4mNLqQ
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# 密码保护

<Warning title="团队版和企业版功能">
  此功能仅适用于[团队版和企业版套餐](https://buildwithfern.com/pricing)。要开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。
</Warning>

密码保护允许您使用单个共享密码或多个密码（最多三个）来限制对文档站点的访问，每个密码都映射到一个角色。这对于预发布文档、内部资源或任何您希望保持私密而无需个人用户账户的内容都非常有用。

在 [Fern Dashboard](https://dashboard.buildwithfern.com/) 中[设置和管理密码保护](/learn/dashboard/configuration/password-protection)。如果您为不同的用户角色设置了多个密码，请配置 [RBAC](/learn/docs/authentication/features/rbac) 来控制不同组能够访问的内容。

## 工作原理

启用密码保护后，文档站点的访问者需要输入密码才能查看任何内容。身份验证成功后，用户可以浏览站点直到会话过期。如果配置了多个密码，输入的密码将决定用户的角色以及他们可以访问的内容。

<Note>
  启用密码保护时，搜索引擎将不会索引您的站点。
</Note>