PDI · Question #140
PDI Question #140: Real Exam Question with Answer & Explanation
The correct answer is A: Lightning Data Service handles sharing rules and field-level security.. When using Lightning Data Service (LDS) in Lightning web components, developers benefit from its built-in security features, as it automatically enforces both sharing rules and field-level security for accessed record data.
Question
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?
Options
- ALightning Data Service handles sharing rules and field-level security.
- BLightning Data Service ignores field-level security.
- CThe with sharing keyword must be used to enforce sharing rules.
- DThe isAccessible ( ) method must be used for field-level access checks
Explanation
When using Lightning Data Service (LDS) in Lightning web components, developers benefit from its built-in security features, as it automatically enforces both sharing rules and field-level security for accessed record data.
Common mistakes.
- B. Lightning Data Service does not ignore field-level security; it actively enforces it to ensure data integrity and user access control.
- C. The
with sharingkeyword is used in Apex controllers to enforce sharing rules, but LDS handles sharing rules automatically at the component level without needing an Apex controller for simple data access. - D. The
isAccessible()method is used for manual programmatic field-level access checks in Apex, but LDS handles these checks automatically when accessing data directly.
Concept tested. LWC Lightning Data Service security
Topics
Community Discussion
No community discussion yet for this question.