Salesforce-Platform-Sharing-and-Visibility-Architect Practice Test

Salesforce Spring 25 Release
77 Questions

To grant Universal Containers sales managers access to shipment records properly, it was necessary to leverage Apex managed sharing. The IT team is worriedabout improper access to records.
What should an architect recommend to mitigate this risk?

A. Use isSharesble keyword in Apex classes to assure record visibility will be followed.

B. Use runAs system method in test classes to test using different users and profiles.

C. Use isAccesible keyword in Apex classes to assure record visibility will be followed.

B.   Use runAs system method in test classes to test using different users and profiles.

Explanation:

When leveraging Apex Managed Sharing, it’s critical to test that the correct users get or don’t get access. The System.runAs() method allows you to execute test code under the context of different users (with varying roles, profiles, and sharing). By writing tests that runAs(distributorUser) or runAs(salesManager), you can assert that sharing entries created by your Apex logic yield the expected visibility.

→ with sharing or isShareable (A, C) control runtime sharing behavior but don’t verify it.
→ Only runAs lets you simulate and validate access in unit tests, giving confidence that your managed sharing rules won’t over-expose or under-expose records.

Salesforce-Platform-Sharing-and-Visibility-Architect Practice-Test - Home
Page 2 out of 77 Pages