You need to sign in to do that
Don't have an account?
Execution mode of controller extension - Please clarify
Can some one please clarify execution mode of controller extension. In Visual force reference, it is documented as below.
My understanding is controller extension enforces the sharing rules of the user. but the line in blue below is misleading.
Does this mean that custom methods in the extension controller will execute in system mode? Some one please clarify.
• A controller extension is a class written in Apex that adds to or overrides behavior in a standard or custom controller.
Extensions allow you to leverage the functionality of another controller while adding your own custom logic.
Because standard controllers execute in user mode, in which the permissions, field-level security, and sharing rules of the
current user are enforced, extending a standard controller allows you to build a Visualforce page that respects user permissions.
Although the extension class executes in system mode, the standard controller executes in user mode. As with custom
controllers, you can specify whether a user can execute methods in a controller extension based on the user's profile.
Correct. Yyou can alwasy add the 'with sharing' keywords to your extension classes to respect permissions.