CRT-450 practice question 21 of 30

A developer is migrating a Visualforce page into a Lightning web component. The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data. Which security consideration should the developer be aware of?

Full set: 201 questions
Answer options
A: Lightning Data Service ignores field-level security.
B: The with sharing keyword must be used to enforce sharing rules.
C: Lightning Data Service handles sharing rules and field-level security. Correct answer
D: The isAccessible () method must be used for field-level access checks.
Correct Answer:
C. Lightning Data Service handles sharing rules and field-level security.
Explanation

Lightning Data Service (LDS) is designed to simplify data access in Lightning components by automatically handling platform security features. It respects the running user's context, meaning it inherently enforces both record-level access granted by sharing rules and object-level permissions, as well as field-level security (FLS). When a component requests data via LDS, the service ensures that only the records and fields the user is permitted to see are returned, without requiring the developer to write explicit server-side or client-side checks.

References

1. Salesforce Lightning Web Components Developer Guide: In the "Work with Salesforce Data" section, under "Data Guidelines," it states: "Use Lightning Data Service to load, create, edit, or delete a record without using Apex code. Lightning Data Service handles sharing rules and field-level security for you."

2. Salesforce Lightning Web Components Developer Guide: In the "Lightning Data Service" section, under "LDS and Security," it explicitly states: "Lightning Data Service respects sharing rules and field-level security. If a user doesn’t have access to a record or field, it isn’t available to them."

3. Salesforce Platform Developer I Certification Study Guide (SU23): In the "User Interface" module, the section on "Lightning Data Service" explains that LDS provides access to data displayed on a page and automatically enforces FLS and sharing rules, which simplifies development by removing the need for Apex controllers for basic data operations.

Scroll to Top