Sub topic 2
Roles and the Role Hierarchy in Salesforce
Assume you know basic Salesforce Setup, users, profiles, permission sets, standard objects, and simple SOQL. This chapter focuses on record access.
Roles and profiles
A role is a position in Salesforce's role hierarchy. It helps determine which records a user can access through management levels. A role does not normally give a user permission to open an object.
A profile is a collection of permissions for objects, fields, and system features. A permission set adds permissions to a user without changing the user's profile.
| Setting | Main question it answers |
|---|---|
| Profile or permission set | Can this user work with this object or field? |
| Role | Which records can this user inherit through the hierarchy? |
A role is not automatically the user's job title or reporting line. Administrators design roles for data access. Two users with the same job title may need different roles, and some users may not need a role at all.
The role hierarchy: access flows upward
When the role hierarchy grants access for an object, users higher in the hierarchy can access records owned by users below them. This access is usually in addition to access from ownership, org-wide defaults, sharing rules, teams, or manual sharing.
For example, suppose the hierarchy is:
Regional Manager
└── Sales RepresentativeIf the org-wide default for Account is Private, a sales representative can work with their own accounts. The regional manager can usually access accounts owned by that representative. The representative does not automatically receive access to accounts owned by the manager or by another branch.
Grant Access Using Hierarchies and custom objects
For many standard objects, Salesforce grants hierarchy-based access by default. For custom objects, the object's sharing settings include Grant Access Using Hierarchies.
When enabled, users above the owner can inherit access. When disabled, the role hierarchy does not open records owned by users below them. Owners and administrators can still have access through other mechanisms.
Putting it together
To predict access, check these items in order:
- Does the user's profile or permission set allow access to the object?
- Does the user own the record?
- What baseline does the object's org-wide default provide?
- Is the user above the owner in the role hierarchy?
- Do sharing rules, teams, manual shares, or View All and Modify All add access?
The most restrictive missing layer wins. A role cannot let a user edit an object that their permissions make read-only or inaccessible.
Exercise
A user has Read permission for Account, the Account default is Private, and the user is above the owner in the role hierarchy. Can the user edit the Account?
Show answer
The user can usually see the Account through the hierarchy, but can edit it only if object permissions and any required field permissions also allow editing.