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
mavsmavs 

Visualforce pages access to Users in our org

Hi

 

We developed few VF pages in sandbox. 

When users in our org tries to access the pages in sandbox they are getting the below 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.

 

Do i need to enable any settings/options on the user profile?

 

Users access this page by clicking on the custom link on the Home Page.

 

This is the page and controller

 

I noticed one more thing. Users with Modify All Data rights are able to access the pages.

 

Please advise.....Thanks

<apex:page controller="Redirecting_user" action="{!init}" >
      <apex:form >
      </apex:form>
</apex:page>

public class Redirecting_user { List<customObject__c> cust; public PageReference init() { cust=[select fields__c from customObject__c where ID__c=:UserInfo.getUserId()]; Integer count=cust.size(); return redirectTest(count); } public PageReference redirectTest(Integer count) { PageReference myPR = null; if (count == 0) myPR = Page.ABC1; else myPR = Page.ABC2; if (myPR != null) myPR.setRedirect(true); return myPR; } static testMethod void results() { Redirecting_user test=new Redirecting_user(); test.init(); } }

 

Best Answer chosen by Admin (Salesforce Developers) 
Venkat PolisettVenkat Polisett

Go to setup->App setup->Develop->Pages. Click security link and add the profile of the user that needs access to that page.

 

Do the same for Apex Classes referenced on the page.

Message Edited by Venkat Polisett on 04-08-2009 02:30 PM

All Answers

Venkat PolisettVenkat Polisett

Go to setup->App setup->Develop->Pages. Click security link and add the profile of the user that needs access to that page.

 

Do the same for Apex Classes referenced on the page.

Message Edited by Venkat Polisett on 04-08-2009 02:30 PM
This was selected as the best answer
mavsmavs
oh my god....thanks a lot.....