1

On the Account page layout, I developed a Visualforce page to insert in a section. I want this section to only be able to be viewed by three specific users. Is there a way to do this?

  • You would probably need to have this as a separate page layout that only the three users can view. If you control permissions through just the visualforce page, the other users will still see the spot where the page should be. – martin Jun 8 '16 at 14:26
  • Thank you for answering! I don't think it's a big deal if anybody else sees the section existing, as long as they can't see the data. How would I control the permissions through the visualforce page? – Natalie Spatharakis Jun 8 '16 at 14:28
  • You could either do it through permissions on the user profile or with a permission set. If these three users share the profiles with people who shouldn't be able to view the page, a permission set would be better. – martin Jun 8 '16 at 14:31
  • I'm still pretty new to VF -- how exactly do I go about this? I'm not sure what a "permission set" refers to. Is this something I do in their individual user profile? If so, how does it connect to the VF section? If not, what kind of code do I use in the page itself? – Natalie Spatharakis Jun 8 '16 at 14:34
  • The permission set is not part of the vf page itself. The user profile does allow for access control to visualforce pages, but a profile is not necessarily unique to an individual. A permission set provides permissions that you would find on a profile, but lets you choose specific individuals to give the permissions to. – martin Jun 8 '16 at 14:37
2

I see two ways

  1. Create a separate page layout for those 3 users and assign it to their profile. => take into account that any user that gets that profile as well will see the visualforce page as well

  2. in your VF page, only show stuff for users that are allowed to see it: eg those 3 users. You can define weater or not it is allowed using a hierarchical custom setting. This concept is explained here in the context of trigger execution, but is applicable is this scenario as well. http://www.absi.be/personalize-automation-salesforce.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.