フリー問題

Salesforce Certified Platform Developer のフリー問題 15 / 20 問目

問題文

A staffing agency has one Apex service class that several components reuse. Most callers must respect the running user's record access, but one recruiting screen has to show candidates outside the recruiter's own territory. How should the class be declared?

選択肢

  1. Declare the shared service with inherited sharing so it runs in the mode of whoever called it, and put the without sharing declaration on one narrow class that only the recruiting screen calls.
  2. Declare the shared service with sharing and let the recruiting screen pass a flag that the class checks, switching to a query that specifies system mode when the flag is set so that the elevation is decided by the caller at run time.
  3. Declare the shared service without sharing and have each caller filter out the results that it does not want to show to the user who is sitting in front of it.
  4. Declare the shared service with no sharing keyword at all, because the documentation states that an omitted declaration behaves exactly like inherited sharing and is therefore the same thing written more briefly.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。