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
jucuzoglujucuzoglu 

How do you preview a specific sites page as Admin?

I have a sites page that is not part of the navigation that I would like to preview in Admin mode. How do I preview that specifc page in Admin mode.

 

Right now I am getting an Authorization Required message which is not very useful for debugging purposes. I have tried logging the public user but even then the logs don't tell me which field or script etc... that the public user does not have access to that is generating the run time error.

 

 

cloudmaniacloudmania

There is a link as "Preview as Admin" at right side of the site url under the setup > develop > site > ur site 

jucuzoglujucuzoglu

That Preview as Admin link only shows me the default site page. What if I want to preview a specific page as an admin that is not the default site page?

cloudmaniacloudmania

You display the all pages that has been added in to the Site  as an Admin if you click the Preview As Admin link.

If you want to track your errors ,why dont you use debug log?

jucuzoglujucuzoglu

When I click on the Preview as Admin link it goes to http://myorg.force.com/page. However I want to go to http://myorg.force.com/PlacementPreferences?id=a0C8000000BFLng

 

Maybe my default behavior for Preview as Admin is doing something different than what should be happening. I don't see a list of all site pages when clicking preview as admin it just redirects to a page.

 

I tried using the debug log on the public sites user however it does not give any detail as to what is causing the Authorization Required message. I have a very strong feeling that it is related to a view permission that is lacking in one of the objects that the page is attempting to access.

 

I tried replacing the internal VF page code with a text string and still getting the error which must mean something in the custom controller I am calling (which the Site user has permission to see) must be doing something that the Sites user is not permitted to access.

 

I had a similar symptom which turned out to be DML that I was trying to run in the constructor, however that is not the problem that is happening here. So I am trying to figure out what I can do to get more clarity on the issue since Debug Logs and viewing the Visual Force pages directly don't shed any light on the problem.

 

Currently I am trying to work with this tutorial to see if it tells me a bit more about what might be going on: http://www.tgerm.com/2010/10/debugging-sites-authorization-required.html

 

So thats kind of where I am at. I probably should be posting my controller code, but really want to know how to debug this issue better as I seem to experience trouble with permissions when creating Sites pages often.

Deborah Levy 10Deborah Levy 10
Hey, 
Did you fix the error ? I have the same problem..