I worked for an organization that uses Salesforce CRM. While working on the project, there were roles (positions) for HR, manager, and employee. The access level of roles in such a way that no one can view or access each other’s data, like a manager can only view the data of the records accessed to him.
However, the requirement was that, people in a particular role should see the data from top to bottom, like HR-> Manager-> Employee. For that, we have a feature called Role Hierarchy in Salesforce.
Here, I will explain about the Role and Role Hierarchy in Salesforce. In that, we will see how to add roles to the role hierarchy and assign users to roles in Salesforce with the following examples:
- Example 1: Add Roles to Role Hierarchy in Salesforce.
- Example 2: Assign a User to a Role in Salesforce.
- Example 3: Assign Role to User from User Profile in Salesforce.
Roles in Salesforce
A role in Salesforce defines a user’s visibility access at the record level. Roles show the user’s position in the organization. Simply, it describes what a user could see within Salesforce.
For example, your organization has different roles, and some users work in those roles. Now, the admin has given permission to each role, and the users in that role can access the data according to the permission the admin has given to that role.
Role Hierarchy in Salesforce
In Salesforce, roles come under record-level security. We can control access data when we set up the role hierarchy, and role hierarchy determines the flow of record-level access. Each role has a specific level of authority and responsibility from a higher position to a lower positional structure.
The important thing is that in Salesforce, a role can only be used when the object’s OWD (Organization-Wide Default) is Private.
When the OWD(Organization-Wide Default) is not private, there is no need to use role hierarchy because users can access each other’s records. On the other hand, when the OWD is private, we can access records from the higher level to the lower level using role hierarchy.

Here, we can edit the Role Name as per our requirements.
Example 1: Add Roles to Role Hierarchy in Salesforce
Using the following steps, we can add roles to the role hierarchy or we also can edit existing roles in Salesforce.
1. Click on the “Gear icon,” then go to “Setup” and in “Quick Find Box” -> Search ” Roles” -> Click on “Roles.”

2. Click on the Set up Role option.

3. Then click on the Expand All option. Click on Add Role where you want to add. Here, I have selected the role below the CEO, which means he will report to the CEO.

4. Enter the necessary information and click on the Save button.
- Label: Define your role name, eg. I want to create a “Hiring Manager. “
- Role Name: In this field, the API name will be automatically populated according to the entered label.
- This role reports to: You can specify to whom this role reports using the lookup icon. I have selected “CEO. “
- Role Name as displayed on reports: In this field, you need to enter the label you want on reports.

This is how we can add roles to the role hierarchy in Salesforce.
Read How to Grant Access Using Hierarchies in Salesforce.
Example 2: Assign a User to a Role in Salesforce
After creating roles, adding the User to a particular role is very necessary. In the following steps, I have explained how to assign a user to a role in Salesforce.
1. After creating the role, click on the Assign Users to Role.

OR
If you have already created a role and you just want to assign a user to it, you can also click on “Assign.”

2. Then click on Available Users search, Select the user, click on Add Button, and Save it.

3. Now you can see that a New role has been assigned to the User.

This is How we can Assign a User to a Role in Salesforce.
Read How to Setup Manual Sharing in Salesforce.
Example 3: Assign Role to User from User Profile in Salesforce
When we create the User Profile and know which role we have to assign this user, then this is the simplest way to assign a role to the user.
It is not necessary to assign roles to users from the user profiles; we can assign them while creating roles in the role hierarchy. When creating a new user or editing the user in the Org, there is a field to select a “Role.”
Using the following steps, we can add the role to a user from the user profile in Salesforce Lightning.
1. Click on the “Gear icon,” then go to “Setup” and in “Quick Find Box” -> Search ” User” -> Click on “Users.”

2. Click on “New User” if you want to do it for a new user.
OR
If you want to edit an already existing user, click on “Edit.”

3. Once the user profile is opened, click on the “Edit” button.

4. Select a “Role” from the dropdown list that you want to assign to that user, and after that, click on “Save” to save that user.

5. You can see the role has been assigned to a user.

This is how you can assign a role to the user from the user profile in Salesforce Lightning.
Conclusion
In this, we got an idea about roles and role hierarchy, when we use roles in Salesforce, how to assign roles to new users and existing users from user profiles, and how to Assign a User to a Role in Salesforce.
We have also discussed how to create roles in Salesforce’s role hierarchy and learned how to assign users to a particular role using examples and explanations.
You may like to read:
- How to Grant Access Using Hierarchies in Salesforce
- Organization-Wide Defaults in Salesforce
- Field-Level Security in Salesforce
- Sharing Rules in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.