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?