Defining record level security rules
Before you begin
Review the following information: Best practices for security rules
Procedure
- Click
> Users and
Security > Security Rules. - Click the name of the object type for which you want to define a security rule.
- In the Record Level Security Rules section, click Add.
- Add a name and description for the security rule.
- In the Security property, specify how the security rule is combined
with role-based security.
- Select Restrict to apply both the role-based security and the
security rule.
This option configures more restricted security. For example, if role-based security is set to Read and the security rule is set to Update, the Restrict setting provides read only access.
- Select Extend to bypass role-based security when the outcome of the
formula is true.
For example, if the role-based security is set to Read and the security rule is set to Update, the Extend setting allows a user to update information.
- Select Restrict to apply both the role-based security and the
security rule.
- Specify the access controls. For more information, see Minimum access controls for object operations.Note: Security rules for Create access are defined separately from rules for Read, Update, Delete, and Associate access. When you click Create, the other access options are unavailable.
- Create
- Users can create objects.
When a rule allows users to create objects, the formula cannot include fields within the object. It can include fields from the parent hierarchy, and other conditions that do not include fields. If you select Create, you cannot select any other access control for the rule.
Note: When you define record level security rules for the Create access control, use them only to further restrict role-based security. - You must use the Intended Parent term in the field when you use Create.
- Read
- Users can view the object.
- Update
- Users can modify the object.
- Delete
- Users can delete the object.
- Associate
- Users can define associations or disassociations between objects.
When a rule allows users to associate objects, the formula cannot include fields within the target of the association. It can include fields from the child hierarchy, and other conditions that do not include fields.
- Add the formula for the security rule.
You can type the formula or use Add Path, Add Field, and Add Terms to define parts of the formula. You can also use a combination of them. For more information, see Grammar for security rules.
- To reference another object, either a parent or child,
complete the following actions. For more information, see Paths for parent and child objects.
- Click Add Path.
- Click Parent or Child and select whether the path follows parent objects or child objects.
- Click Starting Object Type and select the object type that is the starting point for the path.
- Click Ending Object Type and select the object type that is the ending point for the path.
- Click Search to view the possible paths.
- Select one or more paths. If you select more than one path, use Combine Paths to specify how to use the multiple paths. Select Any Path if you want to use any of the paths or select All Paths if you want all paths to be used for the rule to be applied.
- Click Insert.
- To define a field condition, complete the following
actions. For more information, see Terms for data types.
- Click Add Field.
- Select an object type.
- Select the field that you want to use.
- Select an operator. The list of operators changes depending on the field data type.
- Enter the value of the field condition.
- Click Insert to add the field condition into the rule formula.
If you type the field condition, ensure that you use system names. If you do not specify an object type, the rule uses the object type for the object to which the rule applies. If you specify an object type, the object type must be either the subject of the rule or be specified in a path expression that contains the field reference.
You can use square brackets to ensure that when elements of field references contain spaces or other special characters, these field references are parsed.
- To add operators or keywords, click Add Terms.
- To reference another object, either a parent or child,
complete the following actions.
- Click Validate. For more information, see Validating a formula for a security rule.
- To enable or disable the security rule, click
Status. For more information, see Enabling or disabling a security rule.
- Click Add.