I'm thinking there must be a way to allow Edit/Public Full Access to opportunity objects because it is working for Campaign Members. If I set Public Full Access for the Campaign in Setup -> Sharing Settings then I'm able to update existing campaign member object fields from flow running in a visualforce page using the guest profile. What is weird is on the site profile settings Campaigns under the standard objects doesn't have an Edit permission to check but under Setup -> Shared Settings. The default setting in setup -> shared settings though there is an option for Public Full Access but Campaign object is the only object you can set the default to Public Full Access.
Is there a way to setup Opportunities so I can edit existing opportunities from flow running in the content of a site guest profile within a VisualForce Page?
답변 1개
Hi Dave,
You can code the controller as without sharing and copy the values into and out of an intermediate object.
The documentation for with sharing states:
The with sharing keyword allows you to specify that the sharing rules for the current user be taken into account for a class. You have to explicitly set this keyword for the class because Apex code runs in system context. In the system context, Apex code has access to all objects and fields— object permissions, field-level security, sharing rules aren’t applied for the current user.
So, by specifying without sharing the class runs in system context and has access to the Opportunity. Note that doesn't apply to the Visualforce page, itself, so you couldn't access the Opportunity directly in it via an inputField.
Thanks
Vaishali Kaushik
Mirketa inc.