Certified Sharing and Visibility Architect Exam QuestionsBrowse all questions from this exam

Certified Sharing and Visibility Architect Exam - Question 12


Universal Containers (UC) has a custom Apex class that enforces a business process and updates opportunities. UC has noticed that fields with field-level security permission of read only on certain users’ profiles are being updates by this class.

How should the architect fix this problem?

Show Answer
Correct Answer: AC

To ensure that fields with field-level security permission of read-only on certain users’ profiles are not being updated by the custom Apex class, the correct approach is to use the isUpdateable() Apex method. This method checks if a user has edit/update access to a field, allowing the code to conditionally perform updates only when the user has the necessary permissions. Other methods like WITH SECURITY_ENFORCED in SOQL statements enforce read access but do not verify edit access, and the With Sharing keywords deal with record-level access instead of field-level security.

Discussion

7 comments
Sign in to comment
NoelSFOption: C
Jul 11, 2023

the answer should be C, as a SOQL with WITH SECURITY_ENFORCED will still execute correctly and verifies Read access for Field and Object, not Edit access.

btiba2223Option: C
Aug 23, 2023

answer should be C https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_with_security_enforced.htm

amanad13Option: C
Jun 9, 2023

isUpdateable can be used on fields to check if a user has edit/update access to that field. WITH SECURITY_ENFORCED is just for soql retrieving records & with sharing keywords have to do with record level access and not field or object level access.

nerdycuteOption: C
Oct 10, 2023

Answer should be C.

Nilesh_NandaOption: C
Jan 7, 2024

The answer should be C

RangyaOption: A
Feb 25, 2024

A and C both are the ways to achieve this. With C, we can have graceful handling of access error while with A, it throws an exception causing any further transaction termination.

BlackFox91Option: C
Jun 28, 2024

Should be C. The isUpdatetable allow to control access in edition of a field, while the A will trigger an error only if the field is not visible to the user