-
Notifications
You must be signed in to change notification settings - Fork 96
soqlDatatable: Security
James Hou edited this page Feb 12, 2021
·
4 revisions
soqlDatatable uses an @api queryString to process its data.
Because this data point is coming in from a dev (or admin, for Record Pages / Screen Flows) as a SOQL string, there are some some built in security considerations:
This class is responsible for creating payloads of lightning-datatable
compatible tableData and tableRows.
It uses the following security mechanisms:
- Declared as
inherited sharing.- For
@AuraEnabledmethods, this is effectivelywith sharing. - Allows this class to be called by yours to do
without sharing.
- For
- Single quotes are supported as a feature, however:
- All queried fields to be given a column definition are checked with
field.isAccessble()for READ access. - All queried fields to be returned to the UI as JSON are checked with
Security.stripInaccessible(AccessType.READABLE, queriedRecords)for READ access.
- All queried fields to be given a column definition are checked with
- Since the
queryStringproperty is exposed as an@apithis library assumes the user knows what they are doing if they place this on the Lightning App Builder, Screen Flow, or as a child in your own LWCs.
This class is responsible for searching lookup records during inline edit.
It uses the following security mechanisms:
- Declared as
with sharing. - Uses
String.escapeSingleQuoteson various data points, including the search term.