Restriction Rules
Before You Start
Retrieve and Update Information
Considerations
Tooling API Reference
Metadata API Reference
Previous Versions
Create a restriction rule that controls which tasks members of the Sales Team can access using the RestrictionRule Tooling API object.
Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.
Important
| Required Editions |
|---|
| Available in: Lightning Experience in Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create and manage restriction rules: | Manage Sharing |
| To view restriction rules: | View Setup & Configuration AND View Restriction and Scoping Rules |
You can create up to two restriction rules per object in Enterprise and Developer Editions and up to five restriction rules per object in Performance and Unlimited Editions.
Set a value for the FullName value (the full name of the associated metadata object in Metadata API). We don’t support two consecutive underscores in the FullName field.
Include all other required fields. For more information, see the reference topic RestrictionRule.
For our example, we set the fields as follows:
1{
2 "FullName": "restrictionrulesalesteam",
3 "Metadata": {
4 "active": true,
5 "description": "Sales team can see only task records with specified record type",
6 "enforcementType": "Restrict",
7 "masterLabel": "Sales Team Record Type",
8 "recordFilter": "recordTypeId = '011xxxxxxxxxxxx'",
9 "targetEntity": "Task",
10 "userCriteria": "$User.ProfileId = '00exxxxxxxxxxxx'",
11 "version": 1
12 }
13}Use a POST request to create the restriction rule.
POST /services/data/v55.0/tooling/sobjects/RestrictionRule
Copy your restriction rule definition into the request body.
Execute your request. Note the ID returned for the newly created restriction rule for later reference.
Retrieve and Update Information
Use the GET, PATCH, and DELETE methods to retrieve, update, and delete restriction rules.