RestrictionRule
Represents a restriction rule or a scoping rule. A restriction rule has
EnforcementType set to Restrict and controls the access that specified users have to designated
records. A scoping rule has EnforcementType set to Scoping and controls the default records that your users
see without restricting access.
This object is available in API version 52.0 and later.
Supported SOAP API Calls
create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
Supported REST API Methods
DELETE, GET, HEAD, PATCH, POST, Query
Special Access Rules
Only users with the View Restriction and Scoping Rules permission can view restriction rules and scoping rules via the API. Only users with the Manage Sharing permission can view, create, update, and delete restriction rules and scoping rules.
Fields
Field | Details |
---|---|
Description |
|
DeveloperName |
|
EnforcementType |
|
FullName |
|
IsActive |
|
Language |
|
MasterLabel |
|
Metadata |
|
RecordFilter |
|
TargetEntity |
|
UserCriteria |
|
Version |
|
Usage
The following is an example of a RestrictionRule representing a restriction rule.
{
"FullName":"restriction_rule_tasks_you_own",
"Metadata": {
"active":true,
"description":"Allows users of a specific profile to see only tasks that they own.",
"enforcementType":"Restrict",
"masterLabel":"Tasks You Own",
"recordFilter":"OwnerId = $User.Id",
"targetEntity":"Task",
"userCriteria":"$User.ProfileId = '00exxxxxxxxxxxx'",
"version":1
}
}
The following is an example of a RestrictionRule representing a scoping rule.
{
"FullName":"Department A contact scoping rule",
"Metadata": {
"active":true,
"description":"View contacts from Department A.",
"enforcementType":"Scoping",
"masterLabel":"SR for Department A",
"recordFilter":"Department=$User.Department",
"targetEntity":"Contact",
"userCriteria":"$User.UserRoleId = '00Exxxxxxxxxxxx'",
"version":1
}
}