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
SayasoniSayasoni 

Insufficient Privileges

Hi People,

I have an apex class & visualforce page tab working perfectly well on Admin users.But when a standard user clicks on the visualforce tab, he keeps getting the following error: 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.

On the security of both the apex class & visualforce page i have enabled both profiles.I have checked almost everything regarding profile accessibility & everything looks fine.Kindly guide me on what could be the problem that i have overlooked.


Best Answer chosen by Admin (Salesforce Developers) 
SayasoniSayasoni

Hi Guys,

I was able to resolve the problem.The issue was on the Custom Object Persmissions on the standard users profile.My custom object didn't have the Basic Access & Data Administration rights.I found out that this features can not be edited directly from their specific profiles so i had to clone the profile then edit the access rights on my custom object and that was the solution!

All Answers

cloud_artillerycloud_artillery

The problem could be that the other profiles don't have access to objects that you are displaying in the visualforce page.  You should also check field level security for those objects.  Lastly, it could be an issue with sharing settings.  But I would check the object and field level security settings first.

MandyKoolMandyKool

Additionally,

 

If you want to run the class for all the users; then you can use "Without sharing" instead of "with sharing" keyword.

Not sure what exactly you want in your case; but as mentioned by cloud_artillery do the necessary checks if you want it show for particular users. The "without sharing" will be sought of "Quick Fix" but not recommended :) 

SayasoniSayasoni

I have also access level of all profiles on this object & they all have access to it.The field security level of the object is also correctly set for all profiles.

Am not using the 'with sharing' on my class,so i don't think that is the problem.Though i have tried using 'without sharing' as you recommended but that one too doesn't seem to solve the problem.

Now am really stuck.

SayasoniSayasoni

Hi Guys,

I was able to resolve the problem.The issue was on the Custom Object Persmissions on the standard users profile.My custom object didn't have the Basic Access & Data Administration rights.I found out that this features can not be edited directly from their specific profiles so i had to clone the profile then edit the access rights on my custom object and that was the solution!

This was selected as the best answer