Taking Access Away: Restriction and Scoping Rules
このコンテンツはまだ日本語訳がありません。
Chapter 16 of Securing Salesforce: Sharing and Visibility, Part 3: Beyond the Company and Beyond the Record. New to the course? Start with chapter 1.
Count the ways to share in this course, and almost every one of them opens records. Org-wide defaults, the role hierarchy, rules, teams, territories, implicit sharing, code, sharing sets. In class I put restriction rules this way: this is the first element that lets us narrow access down.
This chapter is about the two tools that narrow. A restriction rule is strict: it filters what the sharing model opened, everywhere the user looks, for good. A scoping rule is soft: it changes what people see first, and they can switch it off. Built the same way, doing very different jobs.
And because a restriction rule leaves no row in the share table, the chapter ends where it has to: with how to prove it works, and how to find it when it’s the reason someone can’t see a record.
The ideas in this chapter
Section titled “The ideas in this chapter”- Open, then narrow. A restriction rule filters what sharing opened, permanently, in list views, lookups, reports, search and queries; View All, Modify All and code in system mode go straight past it.
- Spend the few shots where nothing else works. Filtering the children of a master-detail, a lock on external objects, and a flag on the record such as soft-deleted or confidential.
- Two filters: the user and the record. User criteria or a custom permission decide who; the record criteria decide what they keep; equals only, so compute one field when the real rule needs an AND.
- One rule per user, two to five per object. Salesforce doesn’t stop two rules matching one person, so the design has to.
- Tasks, events and contracts are where rules matter most, because defaults can’t make them private, and where subjects and names can still show through side doors.
- A rule runs every time the user looks. On external objects it’s the only lock on the row and it loads the other system; on large objects, test the filter first.
- A scoping rule is a filter, not a lock. A nice to have for focus, never for “must not see.”
- Prove it, and look for it. Three users and two records; the Sharing Hierarchy shows a blocked user when UserRecordAccess says yes.
The picture
Section titled “The picture”Here’s where the chapter starts: where a restriction rule sits, and what goes past it.
And the one that holds the chapter together: the two rules side by side.
The path through this chapter
Section titled “The path through this chapter”Seven modules, each standing on its own.
- Open, Then Narrow: Where a Restriction Rule Sits. After all of sharing; everywhere the user looks; what goes straight past it; no row, and a query that doesn’t know; which objects and how many; when it’s the right tool; where restriction rules shine.
- Designing the Criteria: the User and the Record. User criteria or a custom permission; the record criteria and Salesforce’s examples; values filled by automation; the rules of the form; the contracts team.
- One Rule per User, Two to Five per Object. Two shots, or five; Salesforce doesn’t check; designing so only one can match; moving rules between orgs.
- The Hard Objects: Activities and Contracts. Why the defaults can’t do it; competing teams on one account; confidential services; what still shows through; contracts and their child records.
- External Objects and Performance. The only lock on the row; the other system’s load; search on purpose; testing the filter on large objects; and when search can’t find a record the user can open (search crowding).
- Scoping Rules: a Filter, Not a Lock. Where they apply; when they help; letting users choose their scope; the details; turning one off.
- Testing and Troubleshooting What Was Taken Away. Three users, two records; testing as the user; Apex and system mode; is it a rule; test again when something changes.
Then check what stuck with the study guide.
What an architect decides here
Section titled “What an architect decides here”- Whether the sharing model should open less in the first place, before a restriction rule narrows it.
- For each rule: the object, who it applies to and through what, the one field it tests, and the automation that keeps that field filled.
- How rules on one object are kept apart, and who is meant to match none.
- Who holds View All or Modify All, and which code runs in system mode, on every object a rule protects.
- For activities, contracts and external objects, what still shows through, and what the other system can take.
- Where a scoping rule helps people focus, and that nobody mistakes it for security.
- The test for each rule, kept with the rule and run again when fields, values, permissions or people change.
Beyond the exam: what AI changes. A restriction rule is a real guardrail for an agent’s user, in queries and search, as long as the agent’s actions run as the user and not in system mode. A scoping rule is no guardrail at all. Before an agent goes live, put its user on the overlap check and into the test as a fourth user, and ask it for the records a rule should hide. Chapter 20 covers agents.
Explore
Section titled “Explore”Each module lists its own sources. Two to start with:
- Restriction Rules (opens in a new tab), Salesforce Help (checked 2026-11-26)
- Scoping Rules (opens in a new tab), Salesforce Help (checked 2026-11-26)
