QuestionQ59

Programmatic Sharing

Universal Containers has a custom Visualforce application that uses a custom Apex controller.

Within this Visualforce application, what should the Architect do to make sure object-level security is enforced?

  • A Use the “Without Sharing” keyword when defining the Apex controller class
  • B Utilize the “With Sharing” keyword when defining the Apex controller class
  • C Use the Schema.DescribeSObjectResult isAccessible() method in the Apex controller
  • D Utilize the “With Sharing” keyword when defining the Visualforce page
Explanation

Schema.DescribeSObjectResult.isAccessible() checks whether the running user has read access to the relevant sObject, enforcing object-level permission checks in Apex. The with sharing and without sharing keywords govern record-level sharing rules and do not enforce object-level permissions.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!