function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lisa.sturycz1.3890322391892622E12lisa.sturycz1.3890322391892622E12 

Override New button with VF page that only some users have security privileges to access

Our Contact object New button is overridden to display a custom VF page with added functionality. However, some profiles do not have access to this functionality and should see the standard page. The VF page has functionality on it that we have to pay to use, so we do not want all users having access. 

Can someone please advise if I can remove access to the override classes/VF pages for all users and then assigned to specific users via a Permission Set? If not, what would be the best way to accomplish what we are trying to do? Thanks!
Balaji Chowdary GarapatiBalaji Chowdary Garapati
Hi Lisa,

Only way to overcome this issue is to have an other visualforce page which is accessible by all profiles, which has logic to redirect to the standard contact creation page or the custom page of yours based on custom logic.  You can use custom settings to dynamically decide which profile to land on which page. (similar to whitelisitng, if the list contains the current users profile redirect him to another vf page else navigate him to the standard contact creation page)

If there is only one page, then the users who doesnt have rights to the vf page will see a Insufficient Priviliges error from salesforce and will be stuck there. 


Hope it helps.,

Thanks,
Balaji
lisa.sturycz1.3890322391892622E12lisa.sturycz1.3890322391892622E12
Is there a way to assign access via permission set rather than profile?
Balaji Chowdary GarapatiBalaji Chowdary Garapati
Yes you can.