If I want a specific field to be visible only to a specific user or group of users on a layout, I set up field-level security for this field. I want to be able to do the same for my custom button added to a layout. I want a specific button be visible only by a specific group of users.
Is there a way to set a ‘button-level’ security in order to achieve this? It would be perfect if I could use a permission set.
I know that there were some questions on how to hide a specific button depending on a specific value of an object’s field (I already use this solution is another situation), but I want a different thing. I want to be able to specify a permission to see a specific button for a specific group of users.
Buttons don’t have a corresponding “button-level” security. There are at least three ways to get around this:
Write a Visualforce page that overrides your default layout. Have that Visualforce page determine if the button should be rendered.
Use page layouts and assign different layouts by profile. Unfortunately, you can’t use permission sets this way.
On the other hand, if the button links to a Visualforce page, you could just restrict access to the page itself; they’ll still see the button, but get an error when they click on it.