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
Imran MohammedImran Mohammed 

Strange Issue : Insufficient Privileges when Visualforce page is accessed?

I am getting Insufficient privileges issue when visualforce page is accessed on a tab.

Actually, the Visualforce page overrides the standard tab of custom object.

 

I have checked all the custom object permissions on the profile and made sure that Visualforce page and Apex classes are enabled for the profile.

The strange thing is that, when i turn on the View Setup and Configuration permission in the profile, the Visualforce page gets rendered well without any issue.

But i don't want that permission to be turned on.

 

If i turn off, i get the same issue.

 

Any thoughts?

Appreciate any help on this.

bob_buzzardbob_buzzard

Is your page accessing/displaying any data outside of your custom object that might need these permissions?  I seem to recall encountering something similar when I was trying to scrape data from the Company Information page into a VF page.

 

Failing that, does your page have an extension/custom controller?  If so, have you tried adding debug to the constructor to see if its an issue gaining access to the page itself, or something that is being done when generating the page.

 

Imran MohammedImran Mohammed

Thanks Bob,

 

I am not accessing any company info.

What i am doing this is 

 

  • Access data from Custom objects. I checked and made sure that i have enough permissions on all the objects. I even tried giving View All and Modify All permissions to that profile, but no luck.
  • I use a custom controller for doing this.
  • I added debug statements and that was of no use, all the debug statements which i added till the end of code were shown in the log.
Do you have any idea on why this is happening?
Any help from you will be appreciated.

 

bob_buzzardbob_buzzard

The only other thing that I've been bitten by around this is sharing - where my controller was declared "with sharing" and I didn't have access to the object in question.  However, modify all data should override sharing, so it doesn't sound like that. 

 

The only other thing I can suggest if you haven't tried already is to comment out some/all of the content on the page which may give you a clue if its field related. 

Imran MohammedImran Mohammed

Thanks Bob,

 

I will try it out and let you know what happens.

I will comment step by step Visualforce page and see what could be the issue.

filledthisout10filledthisout10

If it's any help, this error seems to caused by the Search Results portion of the page.  Very quickly, the Search Parameters portion at the top is displayed before the error message takes over the page.  You should be able comment out the Search Results to confirm this behavior, which if true will hopefully narrow down the problem.

colemabcolemab

This Link helpped me resolve this issue.  Just FYI.

Bo ThompsonBo Thompson
This was exactly what I needed. Thanks colemab.
Taoheed Ansari 3Taoheed Ansari 3
Thanks colemab! It helped me to resolve the issue.
Harold CarlsonHarold Carlson
colemab ~ thanks that's what I was looking for as well.
Joseph BauerJoseph Bauer
Hi Bob,

Mine seems to be field related since none of the fixes above work and commenting out certain fields did fix the issue. I'm a system admin and the fields are set to visible so i'm not sure why it's giving me insufficient privileges. Any suggestions?
Orla KeaneyOrla Keaney
Thanks colemab! This helped me resolve an issue we had
Nicholas Grant MOWNRNicholas Grant MOWNR
Thanks alot colemad. It was exactly what I was looking for. I installed Standard Tab Overrides and users without the system admin profile couldn't view the overridden pages. This helped alot.
Anupam Joshi 5Anupam Joshi 5
Thanks a lot colemab! Was stuck with the same issue!
Shruthi Vasudeva 7Shruthi Vasudeva 7
Thanks @Colemab, very old post, but helped resolve the issue.
Patrick Murphy 54Patrick Murphy 54

Echoing others here...  Thanks Colemab, this resolved my issue too.

FWIW, in SF Classic, you will find the pages now under Develop > Visualforce Pages.