1

We have a Visualforce Contact page in our managed package where there are a number of Actions, e.g.

  • Go to VF page 1
  • Go to VF page 2
  • Render component
  • Execute this javascript

Right now we have universal permissions to show or hide these links. The client wants to make them visible on a user level, but using some kind of groups rather than the more tedious option of using checkboxes on the User object.

So dealing with individual users is out.

Using Profiles I imagine is too broad as there are lots of different combinations for each user.

At first I thought of using Public Groups, but I don't think there is any way to add checkboxes other than using a custom object with a lookup to a Group. Even then, I don't think this is an option because you can't fire a trigger for the Group object and so I wouldn't be able to keep it in sync easily.

I then thought of using Permission Sets which contain Visualforce Page Access / Apex Class Access. I could then query the PermissionSet object in Apex. But then it gets complicated if I want to restrict a javascript call because I can't seem to customize a permission set's App/System Permissions to include "Can Execute JS Call 1".

It doesn't seem like this should be a big deal but I can't think of how to implement. Can anyone help?

4
  • Hm another option might be hierarchy custom settings: help.salesforce.com/apex/…
    – Phil B
    Jan 24, 2014 at 18:09
  • I think Hierarchy Custom settings require a user or profile ID? Neither of which seem particularly appealing...
    – George S.
    Jan 24, 2014 at 18:16
  • Yeah, custom setting will be pain in the hairy one to populate for selected users. But if your client is not giving you any meaningful rules (role based? group based? based on the fact whether they have the "isCreatable" on ObjectX?) what else can you do? You could create some helper config object and store it there... but that's exactly why cust settings were made. Or you can say "screw you" and tell them to clone your VF page & apply the logic they want to their black heart's content ;)
    – eyescream
    Jan 24, 2014 at 22:50
  • @eyescream Actually, CS is a beautiful solution perfectly designed for defining permissions. Anyone who thinks otherwise needs to play with them more extensively.
    – sfdcfox
    Jan 25, 2014 at 4:15

0

You must log in to answer this question.

Browse other questions tagged .