2

I need to render two different contents of my Visualforce page. One when the Package Administrator is accessing it, by remote access (Grant Login Access), and another one to the regular user.

In other words, I wanna know if there is way to check if the user is a regular user, or one by remote access.

Is it possible?

2

I don't think that there is a way to do this, from the system point of view you are the user that you're impersonating through Grant Login Access.

One thing you could potentially do is a have a secret page parameter than enables the other view and not reveal the name/value of that parameter to any clients. Not amazing but should do the trick given that they can't see your apex code.

| improve this answer | |
1

You may be able to sniff out the cookies that get created specifically when you are logged in an another user.

I just did a quick check and the RRetURL cookie may be a good candidate. My cookie had a value like:

"/005?retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DUsers&setupid=ManageUsers"

It looks like your previous session cookies get shunted down into a subdomain or another domain. E.g. My sid cookie went into the c.cs13.content.force.com domain and the logged in users cookie took over the cs13.salesforce.com domain.

With a bit of examination you could probably find the required differences.

| improve this answer | |
0

A Visualforce page is viewable but not editable by the client org.

There is a work around if you DO NOT want the customer to see the contents of the VF Page:

  1. Create the VF page and store the contents (inside the
  2. In the VF Page the only tag would be <apex:outPutText value="page_text"/>
  3. In your controller, grab the contents of the static resource and assign it to the property page_text

This will get you the contents of the page and output it to the page but will hide the contents as the private static resource is only visible to the "package administrator"

I have not tested it but the concept would seem to work...

| improve this answer | |
  • Thank you, but what I really need is a way to check whether the person who is accessing the page is the package administrator or the user. I have to redirect two different pages, one for each case. – Airton Gessner Feb 26 '15 at 20:33
  • You are going to have to be more specific with your question then. As it stands it is unclear what you are trying to do. Without more clarity your question may be closed – Eric Feb 26 '15 at 20:34

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.