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

How to redirect to the Insufficient Privileges page after checking a condition


In a VF page, 
I need to check for a condition in Controller class (Constuctor) when page loads and re-direct to insuffient Privileges page after checking a condition.

In controller constructor i've called a method like this


And ValidateUser will be like this :

public static PageReferance validateUser (){

// Need to fill up the code


Is there any URL in Salesforce to direct to Insuffient Privilages page ??

Anupama SamantroyAnupama Samantroy
Hi ,

If you want a dirty solution :P you can create one ErrorPage and dont give access to anyone. Then in the code you can redirect the user to this error page which will show the insufficient Privileges page.
I dont think there is a direct way to access the standard error page in apex.