Build a secure Account service
Saved Apex runs in system mode and ignores user access unless you check.
Your task
Finish the Account service so reads respect the user's access and create copies lose fields the user can't set.
public with sharing class AS_AD7A552FF932_SecureAccountService {
public class AccessDeniedException extends Exception {}
public static List<String> readableNames(Set<Id> accountIds) {
return new List<String>();
}
public static List<Account> sanitizeForCreate(List<Account> candidates) {
return null;
}
}Requirements
- returnsRequestedNamesSorted should pass
- excludesUnrequestedAccounts should pass
- handlesEmptyIdsWithoutQuery should pass
- stripsNonCreatableSystemField should pass
- preservesOriginalCandidate should pass
- blocksCreateForReadOnlyUser should pass
- blocksReadForNoAccessUser should pass