function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
fgwarb_devfgwarb_dev 

<apex:Form> tag = "Insufficient Privileges" ?

I've got a VisualForce page on tapp0 that when i put <apex:form></apex:form> on it i get our favorite "Insufficient Privileges" error.

 

Remove the tag and the page renders!

 

Any insight?

Best Answer chosen by Admin (Salesforce Developers) 
fgwarb_devfgwarb_dev

You can watch a video of the error here: http://promsendit.com/files/14279_ydnk0/Salesforce_PRM_Insufficient_Privileges.avi

 

When I removed the controller extension from the page declaration the page could be loaded repeatedly; but we needed the controller because that's where all of our custom business logic was.  So commented out the entire class and started loading it back in until I found the tipping point (the line that caused the error to occur.)  

 

It turned out to be a block of map variables like this:

 

Map<String, Asset> projeToAplus = new Map<String, Asset>();

 

I think this resolved the problem because the code was being executed under the User (Partner) context instead of the System context.  This explains the issue because the Partner license doesn't have access to the Asset table.  The unresolved question is "Why was the code executing in the User context instead of System when 'with sharing' wasn't used?"