Roles in Drupal are group of permissions or privileges which control how and what to access on Drupal based web-sites. Drupal allows to create roles and assign them to the users. Then users can access the web-site 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 into your Drupal based website as an administrator.
Step (2). Click on People link which is on top of the page in navigation menu. Drupal will display the People page with LIST and PERMISSIONS tabs.
Step (3). Click on PERMISSIONS tab. Drupal will display Permissions page to let you control how and what people can access your Drupal based web-site.
Step (4). Click on Roles link which is next to Permissions link. Drupal will display Roles page to allow you to fine tune the security and administration of your web-site.
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 what you have created. Click on edit permissions link which is next to the role. This will open permissions page.
Step (7). Observe that Drupal permissions page displayed your newly created role one side and 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 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 People link. Drupal will display the list of users and also allows you to create a new user.
Step (10). Click on 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 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 click on 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.
by Code Steps