# How does the Role Hierarchy interact with OWD settings to grant vertical record visibility?

**Topic:** Admin · **Difficulty:** Medium · **Tags:** Admin, Role Hierarchy, Access Control

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-the-role-hierarchy-interact-with-owd-settings-to-grant-vertical-record-visibility

## Answer

**Basics:** A role describes where a user sits in the reporting structure. When OWD is Private or Public Read Only, a manager in a higher role can still see and, subject to object permissions, edit what their subordinates own. Roles are about record visibility; profiles and permission sets are about what objects and features a user can use.

**How it works:**
1. Setup > Roles > Set Up Roles creates the tree (CEO, VP, Manager, Rep).
2. Assign users to roles (a user can have one role; a role may be empty).
3. For a record owned by a rep, users in roles above the rep get access through "Grant Access Using Hierarchies".
4. The level of access matches the access the subordinate effectively has to that record (owners have Read/Write/Full).
5. Access flows upward only, never sideways: peers do not see each other's records unless shared.

**Advanced / deep dive:** Hierarchy access is calculated through group membership structures rather than a share row per manager, which keeps share tables smaller, but deep or complex hierarchies increase recalculation time; avoid unnecessary levels and ownership by "integration" users at the bottom of large roles. For standard objects the hierarchy cannot be switched off; for custom objects "Grant Access Using Hierarchies" can be deselected in OWD, which is useful for sensitive objects like HR cases. Opportunities and Cases also respond to Account-based implicit sharing. Territory Management is an alternate hierarchy for accounts. Roles also affect reports ("My team's"), forecasts and dashboard views. In Apex sharing, `RowCause` and group IDs (`Group` of type RoleAndSubordinates) represent role-based access.

**Code / config example:**
```text
Role tree:           Sales VP
                     /      \
            EMEA Mgr         NA Mgr
              /   \             \
        Rep A    Rep B         Rep C
Rep A owns Opportunity X (OWD Private):
  Visible to: Rep A, EMEA Mgr, Sales VP, admins. Not Rep B (peer), not NA Mgr.
```

**Hidden gotchas & must-remember points:**
- Roles do not grant object CRUD; the manager's profile must allow it.
- Hierarchy access is upward only; no sideways visibility.
- Custom objects can opt out of hierarchy access; standard objects cannot.
- Users without a role do not get hierarchy benefits and may be invisible to managers.
- Changing a user's role triggers sharing recalculation.
- Role is not the same as a public group or queue.

**Best practice:** Mirror real visibility needs, keep the tree shallow, and use sharing rules or teams for cross-branch access.

---
Source: ForceChallenges · last updated 2026-11-02
