Show answerHide answer
Correct answer: A Extract each permission set, commit and merge to source control, and run through CI checks.
Explanation
ExplanationThe problem: administrators make permission set changes directly (likely in production or without tracking), and these changes cause SOQL statements to fail — almost certainly because permission sets control object and field-level access (CRUD/FLS). If a permission set removes access to an object or field that a SOQL query references, the query fails at runtime with an access-related error.
The root cause is that permission set changes are not tracked, reviewed, or tested before they affect code. The fix is to bring these changes into the source-driven, CI-monitored pipeline:
* Extract each permission set to source control so changes are versioned and visible.
* Commit and merge them through the normal branching process.
* Run CI checks — including Apex tests and static analysis — which will fail early if a permission change breaks a SOQL query or removes required field access.
This surfaces the problem earlier in the lifecycle (in CI, not production), which is exactly what the question asks for.
Why Other Options Are Incorrect
B. Ask administrators to only make changes to profiles instead
— Profiles have the same access-control impact as permission sets (they also grant/revoke object and field access). Switching to profiles doesn't solve the problem and actually goes against Salesforce's strategic direction (permission sets are preferred over profiles). It's a lateral move that doesn't improve early detection.
C. Create a sandbox refresh strategy to refresh every sandbox daily
— Daily sandbox refreshes are impractical, expensive, and slow, and they don't address the root cause. Refreshing a sandbox doesn't track permission changes or run CI checks — it just resets data. It won't bring the issue to the developer's attention earlier in a controlled way.
D. Advise developers to switch to SOSL queries
— SOSL doesn't bypass FLS/CRUD any more than SOQL does. Switching query languages doesn't fix permission-related failures and is a misguided workaround. The issue is access control, not query type.
References
Salesforce Trailhead – Application Lifecycle Management: Source-driven development and CI for metadata (including permission sets).
Salesforce Well-Architected Framework – Security & Operational Excellence: Tracking and reviewing access-control changes.