Record level security allows you to control who can and cannot access individual records. For example, in a list of medical records, each doctor should only be able to view records that belong to their own patients.
Security will be configured differently based on the record source (entity, process, service backed, etc.), and whether the record is synced or unsynced.
Record Level Security for SYNCED Records
If data sync has been enabled on your records, then security can be configured directly on the record. Security can be inherited from related record types, so security can be maintained in a single place and configured via guided experience.
Security can be based on a users’ groups, whether their username is aligned to a particular record field, or whether the user has access to related records.
Download a working version of this example.
In the example application, there is a record type which contains "cases" with sensitive data that should only be accessible to specific users. For example, a specific analyst may have access to cases #250 and #256, but not case #475. To accomplish this, the following are required:
Synced Record Security Implementation
Data fabric makes it easy to set up record security. In this example, we will have a synced Case record and synced CaseUserAssociation record. These will be related to one another by the foreign key - caseId.
Now, you can leverage the data in the related record to properly secure the Case record data.
In the “Record-Level Security” section, you will need two rules:
The first rule enables all users in the Case Global Viewers group to see all Cases.
The second rule says that users whose name is found in the related record field “username” will have access to see those Cases.
Once you have configured both rules, and you have properly created test users and added them to the correct groups, you can use the testing tool to ensure the Case records have been properly secured.
Unsynced Record Security Implementation
Use the design listed below in this document if your record security use case fits both criteria below:
The solution in this document particularly suits, but is not limited to, the following situations:
Design Description:
There is a common use case in which some users need to have access to all records. Explicitly adding these users to each record in the mapping table is potentially cumbersome and hurts performance. Instead, use this strategy:
This design is used in the example application.