Roles in Drupal are groups of permissions or privileges which control how and what to access Drupal-based websites. Drupal allows to the creation of roles and assigns them to the users. Then users can access the website based on the permissions assigned to the roles.
This article explains the steps to create roles and assign them to the users.
This article applies to:
- Drupal 7.x
Step (1). Log in to your Drupal-based website as an administrator.
Step (2). Click on the People link which is on top of the page in the navigation menu. Drupal will display the People page with LIST and PERMISSIONS tabs.
Step (3). Click on the PERMISSIONS tab. Drupal will display a Permissions page to let you control how and what people can access your Drupal-based website.
Step (4). Click on the Roles link which is next to the Permissions link. Drupal will display the Roles page to allow you to fine-tune the security and administration of your website.
Drupal allows you to add roles from Roles page. A role defines a group of users that have certain privileges which can be defined on the permissions page.
Step (5). Enter the role name you want to create and click on Add role button. Drupal will create a new role and display in the roles list. Eg: enter “poll editor” as the new role.
Step (6). Now you need to assign privileges or permissions to the role that you have created. Click on edit permissions link which is next to the role. This will open the permissions page.
Step (7). Observe that the Drupal permissions page displayed your newly created role on one side and on the other side Drupal displays the list of permissions. Now you need to select the permissions for the new role.
Step (8). Select the relevant permissions by checking the check-boxes under the new role. Then, scroll down the page and click on the Save permissions button to save the permissions associated with the role.
Step (9). Now you need to assign this new role to the existing users or newly created users. Again, click on theĀ People link. Drupal will display the list of users and also allow you to create a new user.
Step (10). Click on the edit link which is next to the user to whom you want to assign the roles. Drupal will display the page to allow to change user information.
Step (11). Scroll down and look for the Roles section. Notice that the new role is displayed along with the existing roles. Select the role by selecting the check-box before the role name and clicking on the Save button to save the changes.
Step (12). Log in as a user to whom you assigned the newly created role and check how the roles are working.