Concept 1 of 8Access model

The record sharing model

Org-wide defaults, role hierarchy, sharing rules, teams, territories, manual and Apex managed sharing, implicit sharing, and restriction and scoping rules: how Salesforce decides who sees which records.

Your confidence:Not rated

Simple explanation

Record access is opened up in layers from a locked baseline:

  1. Org-wide defaults (OWD): the most restrictive access per object (Private, Public Read Only, Public Read/Write, Controlled by Parent). Separate internal and external defaults.
  2. Role hierarchy: managers see what their subordinates own (can be switched off per custom object with Grant Access Using Hierarchies).
  3. Sharing rules: owner-based or criteria-based, granting access to public groups, roles or territories.
  4. Teams (account, opportunity, case) and territories (Enterprise Territory Management).
  5. Manual sharing by owners, and Apex managed sharing (__Share rows with a custom reason) for logic rules can't express.
  6. Implicit sharing: for example, access to an opportunity, case or contact gives read access to its parent account.

Narrowing access: restriction rules filter which records users see even if sharing grants them (supported on custom objects and some standard objects, but not Case) βš‘ verify supported objects; scoping rules set a default scope for list views and searches without removing access.

Design method: start from the most restrictive OWD that works for most users, then open access with the fewest, simplest mechanisms. Prefer criteria-based rules and groups over many manual shares.

Real-world analogy

An office building. OWD decides whether doors are locked by default. The role hierarchy gives managers master keys to their team's offices. Sharing rules are standing arrangements ("Finance can enter every meeting room on floor 3"). Teams are project rooms for named colleagues, manual sharing is lending your key, and restriction rules are frosted glass: you might be in the room, but you only see what's meant for you.

Worked example

Wealth management firm:

  • Account OWD Private, Opportunity Private, Case Private; Grant Access Using Hierarchies on for branch managers.
  • Criteria-based sharing: accounts with Segment = Institutional shared read-only with the Institutional Desk public group.
  • Account teams for advisers covering a household with a lead adviser.
  • Apex managed sharing for a "co-advisory agreement" object: when an agreement is active, the partner adviser gets read access to the client's accounts, removed when it ends.
  • Restriction rule on a custom Advice_Note__c object so compliance officers see only notes flagged for review.

Diagram

Rendering diagram…

Key points

  • Start from the most restrictive OWD, then open access in layers.
  • Layers: role hierarchy β†’ sharing rules β†’ teams and territories β†’ manual and Apex sharing.
  • Implicit sharing gives parent account read access from child records.
  • Restriction rules narrow visibility (not supported on Case); scoping rules set defaults.
  • Separate internal and external OWDs.
  • Prefer groups and criteria-based rules; avoid thousands of manual shares.

Limits and gotchas

  • Sharing recalculation after OWD, hierarchy or rule changes can take hours in large orgs; schedule it.
  • There are limits on the number of sharing rules per object βš‘ verify current values.
  • Apex managed sharing rows with a custom reason survive owner changes; rows with the manual reason don't.
  • Users with View All / Modify All (object or org-wide) bypass sharing; audit who has them.
  • Controlled by Parent objects inherit access from the master record; you can't share them separately.

🎀 How to say this in an interview

Draw the layers, then design for the scenario with the fewest mechanisms. Interviewers reward naming implicit sharing, restriction rules (and their Case limitation) and recalculation cost.

Common follow-ups

When would you use Apex managed sharing?

When access depends on logic sharing rules can't express, such as a relationship stored in a junction object or a time-bound agreement. Use a custom sharing reason so the shares survive owner changes, and recalculate them in a batch when rules change.

Restriction rules vs making the OWD private?

Private OWD plus sharing decides who has access. Restriction rules filter what users with access see, which helps when access is broad for operational reasons but visibility must be narrower. They don't support every object (not Case), so check first.