Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Security and Access

The Salesforce Security Model: Four Layers of Access

Understand how Salesforce protects data in layers: org access, object permissions, field-level security and record sharing, plus how to design least-privilege access.

Salesforce security is built in layers, from the whole org down to a single field. A user needs to pass every layer to see or change a value. If you remember one thing from this chapter, make it the picture of these layers, because almost every "why can or can't this user see that?" question is answered by walking through them in order.

The layers

flowchart TD
    A["1. Org access<br/>login, IP ranges, MFA, hours"] --> B["2. Object access<br/>profiles and permission sets: CRUD"]
    B --> C["3. Field access<br/>field-level security"]
    C --> D["4. Record access<br/>ownership, OWD, roles, sharing"]
    D --> E["User sees the value"]

Access is the intersection of all layers: failing any one hides the data.

  1. Org access: who can log in at all, and from where. Controlled by user accounts, passwords, multi-factor authentication, login IP ranges and login hours.
  2. Object access: which objects a user can Create, Read, Edit, Delete (often called CRED or CRUD), plus View All and Modify All. Granted by profiles and permission sets.
  3. Field access: which fields on an object a user can see and edit. Granted by field-level security.
  4. Record access: which individual records the user can open. Controlled by ownership, organization-wide defaults, the role hierarchy, sharing rules, teams, manual sharing and Apex sharing.

Layers 2 and 3 say "what kinds of data"; layer 4 says "which rows". A user with Read on Opportunity can read only the opportunities that layer 4 lets them reach.

The principle of least privilege

Start from no access and add what each job needs. It is far easier to explain why someone has access than to find out later why they should not. Record access begins restrictive (Private default) and opens up through hierarchy and rules, while object and field access is granted with profiles and permission sets.

Users and licenses

Every person who logs in has a User record with: username (an email-format identifier), email, profile (mandatory), role (optional but central for sharing), license, locale, time zone and manager. Create users in Setup > Users. Deactivate (do not delete) leavers: Salesforce does not allow user deletion, and old records still refer to the user. If a user must be blocked immediately, freeze the account first; this stops login without changing assignments.

Which tool controls what

Question Tool
Can they log in, from which IP, when? Login IP ranges, login hours, MFA, session settings
Can they Create/Read/Edit/Delete an object? Profile and permission sets
Can they see or edit a field? Field-level security
Can they use an app, tab, or run reports? Profile and permission sets
Which records can they see? OWD, roles, sharing rules, teams, manual sharing
Can they edit all records regardless? "Modify All" and "View All" permissions (use rarely)

"View All" and "Modify All"

Each object has two powerful extras. View All Records lets a user read every record of an object regardless of sharing. Modify All Records also lets them edit and delete everything. System-wide equivalents are View All Data and Modify All Data. These bypass record sharing completely. Give them to admins and carefully chosen support roles only.

A decision procedure for access problems

When a user says "I can't see X", walk down the layers:

  1. Is the user active, not frozen, with the right license?
  2. Does their profile or permission sets give Read on the object?
  3. Does field-level security show the field?
  4. Is the field on the page layout or Lightning page?
  5. Do sharing settings give them the record (owner, role hierarchy, rule, team)?
  6. Is a filter or list view hiding it? Is it a record type or validation issue?
Python Stand-in: the layers as a checklist

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The user passes three layers but fails on record sharing, so nothing shows. Real troubleshooting follows the same path.

Tools to investigate

  • Login As a user (Setup > Users > Login, if the user has granted access or your org allows admins to log in) to see their view.
  • User Access and Permissions Assistant (Setup, in orgs where available) shows effective object and field permissions.
  • Sharing > Why? on a record: the Sharing button on a record shows who has access and why (owner, role, rule).
  • Debug logs for code and flows.
  • Setup Audit Trail to see who changed security recently.
  • Health Check (Setup) scores your security settings against Salesforce's baseline.

Security versus visibility versus convenience

Hiding is not securing. Removing a field from a layout merely hides it; moving someone out of a role may hide records but does not remove their profile's object rights; and "View All" bypasses all sharing rules. When in doubt, test with a real low-privilege test user in a sandbox.

Python Stand-in: View All bypasses record sharing

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which layer decides whether a user can see an individual record?

    Object and field permissions say what kinds of data; record access says which rows.
  2. 2. What is the principle of least privilege?

    Grant the minimum needed; it is easier to open access than to find and remove excess later.
  3. 3. What does View All Records on an object do?

    View All bypasses sharing for reading; Modify All also allows editing and deleting.
  4. 4. What should you do with a user who leaves the company?

    Users cannot be deleted. Deactivate them; freezing blocks login at once while you complete the process.

Summary

  • Access is layered: org access, object, field and record, and a user must pass all of them.
  • Start with least privilege; use View All and Modify All sparingly.
  • Troubleshoot by walking down the layers and use the Sharing button and Login As.
  • Layouts hide, security protects.

Next: Profiles and Permission Sets