I have a custom button set to launch a Visualforce page, and added it to my layout. It's configured like this:

Behavior: Display in existing window with sidebar
Content Source: Visualforce Page
Display Type: Detail Page Button
Visualforce Page: SomeCustomPage

I created a user and removed their permission to view the VF page, so when I navigate to /apex/SomeCustomPage?id=... in my browser it gives me an "Insufficient privileges" error.

I expected that when I removed permission for the VF page, the button would no longer display, but when I navigate to the detail page I'm still able to see and click the button, and it just gives me the "Insufficient privileges" error.

Is there any way I can make this button hide when I do not have permission to view the VF page?

1 Answer 1


Buttons are associated with page layouts and layouts tie into the permissions structure. Specifically, you can assign different page layouts by different profiles. Unfortunately, buttons are not tied to permissions to view a Visualforce page as you are requesting.

Documentation about assigning page layouts can be found here: https://help.salesforce.com/htviewhelpdoc?err=1&id=layouts_assigning.htm&siteLang=en_US

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .