About this question
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []Scenario is, I am inserting an Opportunity and then Opportunity Line Item from a VisualForce page using a controller. When I am doing this I am logged in as a user whose profile licence is "Authenticated Website".
Strange thing is, when on another org logged in as a user whose user profile licence is Customer Portal Manager the same code works fine. Both orgs have Opportunity OWD "Read Only" and Opportunity line item "Controlled By Parent".
To resolve this problem I've used "without sharing" in the class which executes the insertion code, and it works fine from the "Authenticated Website" user. As this may be a security issue when we try to list the app on AppExchange, is there any other way to resolve this problem?