SF-PD2 Advanced Developer Fundamentals Practice Question
Exhibit
{
"ApexClass": {
"Name": "AccountService",
"SharingModel": "With Sharing",
"Method": "process(List<Account> accounts)",
"SecurityCheck": "Schema.sObjectType.Account.isUpdateable()"
}
}Refer to the exhibit. The developer has implemented the security check inside the 'process' method. Why is this implementation insufficient for a secure, professional-grade enterprise application?
⚠ Common exam trap
Candidates often assume that checking object-level CRUD permissions is sufficient for enterprise security, completely overlooking Field-Level Security (FLS) enforcement on individual fields.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The check only validates object-level access and ignores Field-Level Security (FLS).
Performing security checks inside a method is better than nothing, but it fails to address the 'CRUD/FLS' enforcement at the query level and often lacks granularity. The best practice is to utilize a security-focused library or framework to enforce FLS (Field-Level Security) consistently across all fields being accessed, rather than relying on manual, ad-hoc checks which are prone to developer oversight during code maintenance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The check should be performed using 'without sharing' to ensure all data is accessible.
Why it's wrong here
Using 'without sharing' explicitly bypasses user security settings, which is a major vulnerability. Applications must respect the user's permissions to prevent unauthorized access or modification of records. Security should be enforced by default, only opting out when absolutely necessary for specific system-level tasks that require high-privilege access.
- ✓
The check only validates object-level access and ignores Field-Level Security (FLS).
Why this is correct
Object-level access checks (isUpdateable) verify if the user can modify the object, but they do not check if the user has access to the specific fields being touched. An attacker could potentially modify fields they shouldn't see or change, bypassing the intended security model of the organization.
- ✗
The class should be declared 'inherited sharing' to avoid performance overhead.
Why it's wrong here
Inherited sharing does not provide security benefits; it simply allows the class to adopt the sharing model of the caller. This can lead to unpredictable behavior if the calling context is unknown. For a service class, explicit sharing declaration is preferred to ensure consistent, secure behavior regardless of the caller.
- ✗
The method should be annotated with @AuraEnabled to ensure it is secure for Lightning.
Why it's wrong here
The @AuraEnabled annotation is required for server-side controllers to interact with the Lightning Component framework, but it does not perform security validation automatically. It simply exposes the method to the client. Manual security enforcement remains mandatory within the method body regardless of the annotation used for the controller.
About these practice questions
This SF-PD2 question is part of Courseiva's 226-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.