Users & Permissions
The Users & Permissions feature allows the management of the end-users of a Strapi project.
Plan: Free feature.
Role & permission: CRUD permissions in Roles > Plugins - Users & Permissions.
Activation: Available by default.
Environment: Available in both Development & Production environment.
Configuration
Configuring end-user roles
The configurations of the end-user roles and permissions are available in the Users & Permissions plugin section of the Settings sub navigation.
The Roles sub-section of Users & Permissions plugin displays all created roles for the end users of your Strapi application.
From this interface, it is possible to:
- create a new end-user role (see Creating a new role),
- delete an end-user role (see Deleting a role),
- or access information regarding an end-user role, and edit it (see Editing a role).
Click the search button above the table to use a text search and find one of your administrator roles more quickly!
By default, 2 end-user roles are defined for any Strapi application:
- Authenticated: for end users to access content only if they are logged in to a front-end application.
- Public: for end users to access content without being logged in to a front-end application.
The end-user role attributed by default to all new end users can be defined in the Advanced settings sub-section of Users & Permissions plugin (see Configuring advanced settings).
Creating a new role
On the top right side of the Users & Permissions plugin > Roles interface, an Add new role button is displayed. It allows to create a new role for end users of your Strapi application.
To create a new role, click on the Add new role button. Clicking on the Add new role button will redirect you to the roles edition interface, where you will be able to edit the role's details and configure its permissions (see Editing a role).
Deleting a role
Although the 2 default end-user roles cannot be deleted, the other ones can, as long as no end user still has this role attributed to their account.
To delete a role:
- Click on the delete button on the right side of the role's record.
- In the deletion window, click on the Confirm button to confirm the deletion.
Editing a role
The role edition interface allows to edit the details of an end-user role as well as to configure in detail the permissions to access the content of a front-end application. It is accessible from Users & Permissions plugin > Roles either after clicking on the edit button on the right side of a role's record, or after clicking on the Add new role button (see Creating a new role).
Editing role's details
The details area of an end-user role editing interface allows to define the name of the role, and to give it a description that should help administrators understand what the role gives access to.
To edit a role's details, follow the instructions from the table below:
Role details | Instructions |
---|---|
Name | Write the new name of the role in the textbox. |
Description | Write the description of the role in the textbox. |
Configuring role's permissions
The permissions area of an end-user role editing interface allows to configure all possible actions and accesses for content-types and available plugins of the Strapi application.
To configure permissions for an end-user role:
- Click on the name of the permission category to configure (e.g. Application, Content-Manager, Email etc.).
- Tick the boxes of the actions and permissions to grant for the role.
- Click on the Save button.
When ticking an action or permission box, related bound routes of the API are displayed in the right side of the interface.
Configuring providers
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.
To enable and configure a provider:
- Go to the Users & Permissions plugin > Providers sub-section of the settings interface.
- Click on the edit button of the provider to enable and configure.
- In the provider edition window, click on the TRUE button of the Enable option.
- 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).
- Click on the Save button.
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
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,
- if they need to reset the password of their Strapi account.
To configure and edit email templates:
- Go to the Users & Permissions plugin > Email templates sub-section of the settings interface.
- Click on the edit button of the email template to configure and edit.
- Configure the email template:
Setting name | Instructions |
---|---|
Shipper name | Indicate the name of the shipper of the email. |
Shipper email | Indicate the email address of the shipper of the email. |
Response email | (optional) Indicate the email address to which responses emails from the end users will be sent. |
Subject | Write the subject of the email. Variables can be used (see Developer documentation). |
- Edit the content of the email in the "Message" textbox. Email templates content is in HTML and uses variables (see Developer documentation).
- Click on the Finish 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.
- Go to the Users & Permissions plugin > Advanced settings sub-section of the settings interface.
- Configure the settings:
Setting name | Instructions |
---|---|
Default role for authenticated users | Click the drop-down list to choose the default role for new end users. |
One account per email address | Click on the TRUE button to limit to 1 the number of end-user accounts with the same email address. Click on FALSE to disable this limitation and allow several end-user accounts to be associated with the same email address (e.g. kai.doe@strapi.io can be used when logging in via several different providers). |
Enable sign-ups | Click on the TRUE button to enable end-user sign-ups. Click on FALSE to prevent end-user registration to your front-end application(s). |
Reset password page | Indicate the URL of the reset password page for your front-end application(s). |
Enable email confirmation | Click on the TRUE button to enable end-user account confirmation by sending them a confirmation email. Click on FALSE to disable account confirmation. |
Redirection url | Indicate the URL of the page where end users should be redirected after confirming their Strapi account. |
- Click the Save button.
Usage
With the Users & Permissions plugin, the end users and their account information are managed as a content-type. When the plugin is installed on a Strapi application, 3 collection types are automatically created (see Users & Permissions plugin), including "User" which is the only one available directly in the Content Manager.
Registering new end users in a front-end application with the Users & Permissions plugin consists in adding a new entry to the User collection type (see Introduction to the Content Manager for more information about the Content Manager).
If end users can register themselves on your front-end application (see Managing Users & Permissions plugin settings), a new entry will automatically be created and the fields of that entry will be filled up with the information indicated by the end user. All fields can however be edited by an administrator of the Strapi application.
To create a new end-user account:
- Go to the User collection type in the Content Manager.
- Click on the Create new entry button in the top right corner.
- Fill in the default fields of the entry. Additional fields added specifically for your Strapi application by your administrators may be displayed as well.
Field | Instructions |
---|---|
Username | Write the username of the end user. |
Write the complete email address of the end user in the textbox. | |
Password | (optional) Write a new password in the textbox. You can click on the icon for the password to be shown. |
Confirmed | (optional) Click ON for the end-user account to be confirmed. |
Blocked | (optional) Click ON to block the account of the end user, to prevent them to access content. |
Role | (optional) Indicate the role that should be granted to the new end user. If this field is not filled in, the end user will be attributed the role set as default (see Managing Users & Permissions plugin settings). |
- Click on the Save button.