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
PrattyPratty 

Authorization for Sites

Hello All,

 

I have created a site, I have a page called testLogged, which will be accessed by logged in user.

 

But when I hit http://devsitepratik-developer-edition.ap1.force.com/testLogged this url directly

in browser without login then I can see the dashboard which is wrong.

 

So I have used below code for authorization,

 

if(UserInfo.getName().contains('Guest'))
       return page.ErrorPage;

 

but I think I need a better logic for this, so can anybody help me to resolve my queries.

1. Why this is happened? Is it because of portal guest user?

 

2. Is there any Better logic available for this?

 

Thanks in advance.

 

regards,

 

Pratty

 

 

 

a!a!

Hi,

 

In the Active Site home page select the same VisualForce page and click on save.

 

i think it will works. let me know if any query

 

bob_buzzardbob_buzzard

This sounds like you have made that page available to the site guest profile - is that the case?

PrattyPratty

Hi,

 

I got my answer I am using getType() method of UserInfo class now.

 

By the way thanks for your time.

 

regards,

 

Pratty