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
vlad_BLvlad_BL 

Insufficient Privileges

Hi, guys.

I need help with very strange issue.

Let me describe it.

 

I'm developing now some VF Page for Customer Portal. There is a simple button in this page, and its' handler does not execute any DML.

It just collects information and returns to the same page.

 

So, when I click the button, I totally randomly get one of  two results:

 

  1. Everything works fine, and there is no any warning or exception in debug log
  2. I see standard text of Insufficient Privileges exception instead of the page content (though I remain on the same page), and debug log is totally clear – no warnings, no exceptions.

 

Below you can find the code of handler method

 

 

public Pagereference addCnt()
      {
            famAvailable = new List<Selectoption>();
            famAvailable.add(new Selectoption('', '--None--'));
            cntAvailable = new List<Selectoption>();
            for(String fmId : famIdMap.keySet())
            {
                  famAvailable.add(new Selectoption(fmId, famIdMap.get(fmId)));
            }
            mode = 'new';
            Apexpages.currentPage().getParameters().put('sesId', SessionId);
            return null;
      }

 

 

 

 

 

 

Class is created with sharing

I will really appreciate your help.

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Hi vlad_BL,

 

Some steps to be covered :

 

1) Make sure your visulforce page and apex class is added in Customer Portal Profile.

2) Make sure that the object you are putting the query and getting the results should have tallest "read" rights for customer portal profile.

 

If you still face the same problem please explain bit more with some code snippets/scenarios.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Afzal MohammadAfzal Mohammad

Hmm, thats strange as there is no DML operation.

 

Anyways, its worth checking if the vf page and the controller class are enabled for your profile?

 

Afzal

Ankit AroraAnkit Arora

Hi vlad_BL,

 

Some steps to be covered :

 

1) Make sure your visulforce page and apex class is added in Customer Portal Profile.

2) Make sure that the object you are putting the query and getting the results should have tallest "read" rights for customer portal profile.

 

If you still face the same problem please explain bit more with some code snippets/scenarios.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
vlad_BLvlad_BL

Thanks, Arora

 

The problem was in permissions of access to some custom object that I queried instances from.

Its access was not set correctly for use with Customer Portal.