+ Start a Discussion
cgosscgoss 

Action Override to Managed VF page breaks other users

We're experiencing an issue that I don't see a good solution to. We have a managed package installed, and only some users have a license to the package. We've overriden the New button for the Campaign object with a VisualForce page from the aforementioned package. This override works grea for users with a license.


The problem is that if an unlicensed user tries to create a new campaign, they get a "License Required" page, and cannot create campaigns.

 

Ideally, the system would just redirect the unlicensed users to the standard create page, equivilant to adding nooverride=1 to the URL.

 

Any ideas?

stephanstephan
Instead pointing directly to the page in the managed package, you could instead create a VF page that does a conditional redirct based on whether the user is licensed or not.
cgosscgoss

That would work, but I don't know of any way of checking a user's access to a package from apex. I know you can check to see if a running user has access within a package with the UserInfo methods (see this) but I don't think that would be helpful.

 

However, we solved this by using an s-control which does the redirect based on the results of a ping method inside the package.

michaelforcemichaelforce

It's 2 years since this was posted, and the workaround of using an S-Control is no longer an option... any other ideas?  As you said there is a UserInfo method that will tell you if the user has a license or not, but you can't run this method as the user if the user can't run code from your package due to lack of license.  So it seems like a useless function for fully native apps.  Any ideas?