Valid CRT-450 Dumps shared by ExamDiscuss.com for Helping Passing CRT-450 Exam! ExamDiscuss.com now offer the newest CRT-450 exam dumps, the ExamDiscuss.com CRT-450 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CRT-450 dumps with Test Engine here:
Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?
Correct Answer: D
The with sharing keyword on the class declaration enforces the sharing rules that apply to the current user. This means that the user can only see and modify the records that they have access to based on the organization-wide defaults, role hierarchy, sharing rules, manual sharing, teams, and territories. The without sharing keyword, on the other hand, ignores the sharing rules and allows the user to access all records, regardless of ownership or sharing settings. This can pose a security risk and should be used with caution. The schema describe calls and the UserInfo Apex class do not directly affect the sharing rules, but rather provide information about the object and field permissions, and the user's profile and role, respectively. These can be used to check the user's access level, but not to enforce the sharing rules on the custom search tool. References: * Apex Developer Guide: Using the with sharing, without sharing, and inherited sharing Keywords, pages 13-14 * Trailhead: Platform Developer I Certification Study Guide: Apex Basics and Database, unit 3