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
greenstorkgreenstork 

Unable to extend a global virtual custom controller from a managed package

Hello,

 

I've run into an issue that I believe to be a bug. I'm receiving an error on the submit of a form in a Visualforce page. The error is:

 

"Insufficient Privileges: You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. "

 

The page is an unmanaged page, the controller is an unmanaged custom controller that extends a managed custom controller that is global virtual. I'm able to reproduce the error on submit when the extended controller has only 3 lines of code and one custom method that does not override anything from the managed controller. It's also worth noting that the page loads and constructor of the managed controller, via the extended controller fires just fine, without issue.

 

I've reproduced the error in a sandbox with a super-simple example. There is a controller called altController and a VF page called payment3. The page loads, and when clicking submit, you get the insufficient privileges error, which makes no sense.

 

Extended Controller: 

global with sharing class altController extends gwop.PaymentPageController {
   global pagereference doNada() {
       return null;
   }
}
 

 

Visualforce page:

<apex:page controller="altController" title="Online Payments from Groundwire" showHeader="true" >
  <apex:form >
      <apex:commandButton value="Submit" action="{!doNada}" />
  </apex:form>
</apex:page>

 

The page loads, runs the constructor without error. Clicking the button gives this:

 

Insufficient PrivilegesYou do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. 

 

If I take out the extends gwop.PaymentPageController at top, of course, no more error on Submit.  Similarly, if I extend another global class from a different managed package, no error on submit:

 

global with sharing class altController extends gwbase.ONEN_CTRL_LeadConverter {
   global pagereference doNada() {
       return null;
   }
}

 

Also – appears to have nothing to do with permissions, as WITHOUT SHARING makes no difference.  And of course, the same code works fine if the page is contained within the same package as the controller.

 

I've enabled Salesforce support to access this sandbox instance by granting login access. Here is the Org Id:

Org Id: 00DW0000000HPkd

 

This problem is replicable in multiple instances using this managed package and I'd be glad to reproduce it in more than one place.

 

I have created a case in the partner portal, Case #: 07311941

 

Any help is appreciated. This is obviously a huge issue if we are to customize and extend code from a managed package, which is a very common scenario for consultants who customize their managed packages for clients.

 

Thanks,
Dave Manelski

zachelrathzachelrath

It would be very helpful to see the code of the managed class that you are extending (gwop.PaymentPageController). Is there a doNada() method in this class? Does this class have a global or public constructor? Please post the code.