開発者は Visualforce ページを Lightning Web コンポーネントに移行しています。 Salesforce 認定プラットフォーム開発者 I Visualforce ページには、単一のレコードに関する情報が表示されます。開発者は、レコード データにアクセスするために Lightning Data Service を使用することにしました。 開発者はどのようなセキュリティ上の考慮事項に注意する必要がありますか?
正解:D
When using Lightning Data Service (LDS) in a Lightning Web Component (LWC), it's important to understand how data security is handled. Option D: Lightning Data Service handles sharing rules and field-level security. Correct Statement. Lightning Data Service enforces all the security and sharing rules that are in place in the Salesforce org. This includes object-level, field-level, and record-level security. When a component uses LDS to access data, the framework ensures that the user only sees data they have access to. Benefits: Simplifies development by abstracting security checks. Ensures compliance with organizational security policies. The isAccessible(), isCreateable(), and similar methods are used in Apex to check field-level security. In LWC, when using LDS, these checks are handled automatically. LDS enforces field-level security; it does not ignore it. Users cannot see fields they do not have access to. Option C: The with sharing keyword must be used to enforce sharing rules. Not Applicable in LWC. The with sharing keyword is used in Apex classes to enforce sharing rules. It is not used in JavaScript code or LWC components. Reference: Lightning Data Service Considerations Access Data with Lightning Data Service Options Not Accurate: Option A: The isAccessible() method must be used for field-level access checks. Incorrect in LWC Context. Security in Apex Option B: Lightning Data Service ignores field-level security. Incorrect. Apex Sharing Conclusion: When using Lightning Data Service in LWC, developers should be aware that LDS automatically enforces sharing rules and field-level security. This ensures that users only access data they are authorized to view.