Skip to main content

配置用户和权限插件设置

¥Configuring Users & Permissions plugin settings

用户和权限插件通过用户和权限插件设置部分进行管理,可从

¥The Users & Permissions plugin is managed from the Users & Permissions plugin settings section, accessible from

Settings icon

管理面板主导航中的设置。此设置部分允许配置可用的提供者、电子邮件模板和插件的高级设置。它还允许定义终端用户角色及其相关权限(参见 配置终端用户角色)。

¥Settings in the main navigation of the admin panel. This settings section allows to configure the available providers, email templates and the advanced settings of the plugin. It also allows to define the end-users roles and their related permissions (see Configuring end-user roles).

配置提供者

¥Configuring providers

用户和权限插件允许启用和配置提供者,以便终端用户通过第三方提供者登录,通过 Strapi 应用 API 访问前端应用的内容。默认情况下,提供了一系列提供程序,其中包括 "电子邮件",默认情况下为安装了用户和权限插件的所有 Strapi 应用启用。

¥The Users & Permissions plugin allows to enable and configure providers, for end users to login via a third-party provider to access the content of a front-end application through the Strapi application API. By default, a list of providers is available including one, "Email", enabled by default for all Strapi applications with the Users & Permissions plugin installed.

Providers interfaceProviders interface

要启用并配置提供程序:

¥To enable and configure a provider:

  1. 转到设置界面的用户和权限插件 > 提供者子部分。

    ¥Go to the Users & Permissions plugin > Providers sub-section of the settings interface.

  2. 单击提供程序以启用和配置。

    ¥Click on the provider to enable and configure.

  3. 在提供商版本窗口中,单击“启用”选项的“打开”按钮。

    ¥In the provider edition window, click on the ON button of the Enable option.

  4. 填写提供者的配置。每个提供者都有自己特定的一组配置,详细信息请参阅我们的开发者文档(请参阅 设置提供者)。

    ¥Fill in the provider's configurations. Each provider has its own specific set of configurations, detailed in our developer documentation (see Setting up the provider).

  5. 单击“保存”按钮。

    ¥Click on the Save button.

✏️ 注意

Strapi 默认情况下未建议的其他提供者可以通过 Strapi 应用的代码手动添加(请参阅 开发者文档)。

¥Other providers that are not proposed by default by Strapi can be added manually through the code of your Strapi application (see Developer documentation).

配置电子邮件模板

¥Configuring email templates

用户和权限插件使用 2 个电子邮件模板,"电子邮件地址确认" 和 "重设密码",发送给终端用户:

¥The Users & Permissions plugin uses 2 email templates, "Email address confirmation" and "Reset password", that are sent to end users:

  • 如果必须确认他们的账户才能激活,

    ¥if their account must be confirmed to be activated,

  • 如果他们需要重置 Strapi 账户的密码。

    ¥if they need to reset the password of their Strapi account.

Email templates interfaceEmail templates interface

配置和编辑电子邮件模板:

¥To configure and edit email templates:

  1. 转到设置界面的用户和权限插件 > 电子邮件模板子部分。

    ¥Go to the Users & Permissions plugin > Email templates sub-section of the settings interface.

  2. 单击电子邮件模板的名称进行配置和编辑。

    ¥Click on the name of the email template to configure and edit.

  3. 配置电子邮件模板:

    ¥Configure the email template:

设置名称指示
发货人名称注明电子邮件发送者的名称。
发送者电子邮件注明电子邮件发送者的电子邮件地址。
响应电子邮件(可选)指示终端用户的响应电子邮件将发送到的电子邮件地址。
主题写下电子邮件的主题。可以使用变量(参见 开发者文档)。
  1. 在 "信息" 文本框中编辑电子邮件的内容。电子邮件模板内容采用 HTML 格式并使用变量(请参阅 开发者文档)。

    ¥Edit the content of the email in the "Message" textbox. Email templates content is in HTML and uses variables (see Developer documentation).

  2. 单击“保存”按钮。

    ¥Click on the Save button.

配置高级设置

¥Configuring advanced settings

与用户和权限插件相关的所有设置均通过“高级设置”子部分进行管理,包括为终端用户选择默认角色、启用注册和电子邮件确认以及选择用于重置的登录页面 一个密码。

¥All settings related to the Users & Permissions plugin are managed from the Advanced Settings sub-section, including the choice of a default role for end users, the enablement of sign-ups and email confirmation, as well as the choice of landing page for resetting a password.

Advanced settings interfaceAdvanced settings interface
  1. 转到设置界面的用户和权限插件 > 高级设置子部分。

    ¥Go to the Users & Permissions plugin > Advanced settings sub-section of the settings interface.

  2. 配置设置:

    ¥Configure the settings:

设置名称指示
经过身份验证的用户的默认角色单击下拉列表为新终端用户选择默认角色。
每个电子邮件地址一个账户单击“开启”按钮可将具有相同电子邮件地址的终端用户账户数量限制为 1。单击“关闭”可禁用此限制,并允许多个终端用户账户与同一电子邮件地址关联(例如,通过多个不同提供商登录时可以使用 kai.doe@strapi.io)。
启用注册单击“开启”按钮以启用终端用户注册。单击“关闭”以阻止终端用户注册你的前端应用。
重置密码页面指示前端应用的重置密码页面的 URL。
启用电子邮件确认单击“开启”按钮,通过向终端用户发送确认电子邮件来启用终端用户账户确认。单击“关闭”以禁用账户确认。
重定向网址指示终端用户在确认其 Strapi 账户后应重定向到的页面 URL。
  1. 单击“保存”按钮。

    ¥Click the Save button.