Salesforce Certified Sharing and Visibility Architect — Question 12
Universal Containers (UC) uses a custom Lightning component with an Apex class to display shipment information (custom object, private OWD). UC sales managers are complaining about two important points:
Shipment records that belong to their teams can be seen by other users.
Shipment amount should be visible only by managers, but sales reps are able to view it.
Which two features did the development team miss that is causing the problems? (Choose two.)
Answer options
- A. Use isSearchable keyword in Apex classes to assure record visibility.
- B. Use With Sharing keyword in Apex classes to enforce sharing rules evaluation.
- C. Use runAs in test class to enforce user permissions and field-level permissions.
- D. Use isAccessible() method in Apex classes to check field accessibility.
Correct answer: B, D
Explanation
The correct answer is B and D because using the With Sharing keyword ensures that sharing rules are respected, preventing unauthorized access to records. Additionally, the isAccessible() method checks if the current user has access to specific fields, which is critical for controlling visibility of sensitive data like shipment amounts.