ApexSensei

Drills Security & deployment

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

  1. returnsRequestedNamesSorted should pass
  2. excludesUnrequestedAccounts should pass
  3. handlesEmptyIdsWithoutQuery should pass
  4. stripsNonCreatableSystemField should pass
  5. preservesOriginalCandidate should pass
  6. blocksCreateForReadOnlyUser should pass
  7. blocksReadForNoAccessUser should pass

Sign in to open this drill