Learn Drupal 8

Written by developers for developers, Drupal allows easy and fast development of every website!

• Last Updated: 02/21/2020
• ( 11 minutes reading )

How to manage Users, Roles and Permissions in Drupal

Introduction

In Drupal, you are able to create users, assign them a particular role(s) and grant them specific permissions. In this tutorial, we will introduce the Users' concept in a nutshell and guide you on how to create, edit, and delete users, as well as how to manage user roles and permissions.

We would like to highlight a few terms to ensure you understand everything perfectly clear and avoid any possible further confusion.

  • Users - A user is any visitor who accesses your website. In Drupal, there are three main groups of users: "Anonymous Users" (users who are not logged in), "Authenticated Users" users who are logged in), and "Administrator" ( users who have access to the Drupal Admin Dashboard, including the SuperUser - User 1).
  • Permissions - The permissions control specific actions that might be performed on your website, such as reviewing or editing content, changing configuration, etc. In order for a user to be able to complete the given action, they need to be granted the corresponding permission.
  • Roles - Roles are used to group users. Instead of assigning permissions to each individual user, you will need to create the desired role and then assign the necessary permissions to it. They will be applied in-bulk to all users with this role.

We believe you should now understand the Users' idea. If it still seems a bit confusing, do not worry. Once we review how they are actually configured, everything will clear up. If you are ready - let's get started!

 

Accessing the People page

In order to begin, we will need you to first access your Drupal Admin Dashboard and navigate through the Administration toolbar to Manage People.

 

Accessing the People page

 

Once you access the "People" page you will notice it consist of three main tabs.

  • List - Under this tab, you will be presented with a list of all accounts currently created on your website. This is where you will be creating, editing, and deleting your users' accounts in the future.
  • Permissions - This is the tab where you will be assigning/unassigning permissions to roles.
  • Roles - From this tab, you will be managing your user roles. You will be able to review, edit, delete and create new user roles.

Please bear in mind that the default administrator (SuperUser - User 1) user and the default user roles cannot be deleted. You also will not be allowed to customize the permissions granted to the SuperUser.

 

Peoples page overview

 

We are positive that everything should be clear now and you are ready to step into actually learning how to manage your Drupal users.

 

Creating a New User Account

At a certain point, you will definitely need to create new User Accounts for one reason or another. Fortunately, this is an extremely simple and straightforward process. We will need you to start off by clicking on the blue "+ Add user" button located in the upper left corner ("List" tab).

 

Add user button

 

Once this is done, you will be automatically directed to the "Add user" page where you will need to specify the required user details. As you will notice they are all related to general user information, however, we will go over each and every one of them in the following lines.

  • Email address - In this field, you will need to specify a valid email address for the user. This email will be used for all internal communication, updates, etc.
  • Username - In this field, you will need to enter the username which will be required from the user to log in to the Drupal Dashboard.
  • Password - In this field, you will need to enter the password for the user account. Please make sure to select a strong password as using insecure login credentials may affect the website security and make it vulnerable to various attacks. Beneath the password field, you will notice a progress bar, which indicates the password strength.
  • Confirm password -In here, you will need to simply retype the password to confirm it matches the one entered above. Below this field, there will be an additional block with recommendations on improving your password strength.
  • Status - The status controls whether the user will be able to log in. You will rarely need to restrict users during new account creations, however, if this is the case, please select the "Blocked"  option.

 

Configuring email, credentials, and status

 

When you are done with these settings, please scroll below on the same page to continue with the rest of the account settings.

  • Roles - In here, you will find a list of all user roles currently created on your Drupal website. You will need to select the desired role(s) by ticking the corresponding checkboxes. The chosen roles will be assigned to the user and determine their privileges.
  • Notify user of new account - This checkbox controls whether an email notification will be sent to the email address specified above to inform the user regarding the account creation.
  • Picture - By clicking on the "Choose File" button you will be allowed to select an image from your local computer which will be used as a user account avatar. Please bear in mind there is a limit of one picture in size no bigger than 1 GB, in one of the following formats: .png, .gif, .jpg, or .jpeg.
  • Personal contact form - This option will allow the user to contact you using a personal contact form which will keep your email address private. It is enabled by default - if you want to disable it, please make sure to untick the checkbox.
  • Time zone - Determines the user account's local timezone. You can select the desired option from the dropdown menu.

 

Configuring rule and picture

 

When you are ready with all the required information, please click on the "Create new account" button to finalize the account creation. Once the account is successfully created you will see it present in the list of accounts under the "List" tab.

 

Creating a New User Role

As we mentioned at the beginning of this guide, the purpose of User Roles in Drupal is to allow you to group users and grant them specific permissions. In addition to the default User Roles, you will be able to create your custom ones to meet the explicit requirements of your website. To do that you will need to now access the last "Roles" tab.

Within this tab, you will see a list of currently created User Roles. You will be able to edit, delete (expect the three default roles), and create roles. To do the last, you must click on the "+ Add role" button at the top left corner.

 

Add role button

 

Once clicked you will be taken to the "Add role" page. All you will need to specify here is the "Role name" and then hit the "Save" button.

 

Configuring and saving role

 

Similar to the previous example, when the role is successfully created you will see it listed below the default User Roles. You can always customize the order they appear in by simply dragging and dropping them to the desired position. This will also affect the order they appear in under the "Permissions" tab which is the next subject of our guide.

 

Assigning Permissions to Role

Whenever a new User Role is created you would want to assign the relevant permissions to it in order to grant its users the capabilities of performing certain tasks and access specific areas of your website. This simple piece of work could be completed in two ways. The first one is through the "Roles" tab by clicking on the corresponding "Edit" button and selecting the "Edit permissions" option. However, in our tutorial, we will be exploring the second way as it will give you an overall idea of the Permissions concept and how you can easily manage all your user roles at once.

Now, to follow us, please access the middle "Permissions" tab where you will be able to edit the permissions assigned to all currently existing user roles.

Once you access it, you will notice that the table header row is split into a few sections. The first one - "Permissions", indicates the column containing all permissions that could be assigned to user roles. If you are not sure what exactly specific permission controls, please take a moment to review Drupal's official Permission reference documentation before you enable/disable the given permission. The following sections (in our case four) indicate the existing Users Roles on your website. In our example, the first three roles are the default ones followed by our custom role, as we did not perform any changes on the roles' order.

 

Permissions tab overview

 

As you have probably managed to figure out - to assign given permission you will simply need to tick the corresponding checkbox under the relevant user role column. Respectively, to unassign it, you will need to untick the intended checkbox. After you perform this action for all desired permissions, please find the "Save permissions" button at the very bottom of the page and click on it to apply the changes.

 

Saving Permission changes

 

Once this is done you will be notified with a confirmation message informing you the permission changes were successfully applied.

This pretty much sums up the Users, Roles, and Permissions topics. Now you should feel confident in your knowledge and abilities to properly administer your Drupal users. We hope the information in this tutorial was useful and our explanations clear. Should you have any additional questions on the matter, feel welcome to contact our Support Team.

 

 

...
Sebahat
Content Marketing Specialist

Sebahat is a young and bright woman who has become an invaluable part of our team. She started as a Customer Care Representative, mastering that role and, along the way, growing into a tech-savvy individual who is well acquainted with every support layer of the company. Driven by her aim to improve our customers’ experience constantly, she is committed to enhancing the extraordinary support we deliver.