Foros de discusión

Hide content from authenticated users?

Nels Lindquist, modificado hace 9 años.

Hide content from authenticated users?

New Member Mensajes: 2 Fecha de incorporación: 26/03/15 Mensajes recientes
We're setting up a portal using LifeRay 6.2.

We'd like to have the "Welcome" page which displays some limited content, and have that page content change after authenticating. So far we've been able to create two Web Content blocks on the page, one of which requires Site Member role to view, the other of which requires Guest role. This works perfectly for the "private" content, which only shows up after authenticating. However, the "Guest" content is visible to everyone, logged in or not. Removing View permission for that content block from Site Members, etc. doesn't hide the content from authenticated users.

Am I missing something? Is there some other way to create "Guest only" content?

Thanks for any advice.
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Hide content from authenticated users?

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Guest view doesn't mean only guests can view, it means anyone can view (even site members have guest access).

May sound odd but it's meant to reduce the amount of work you need to do to maintain permissions in the portal. Imagine if you had to set privileges on every public page, image, document, web content, etc. if you had a bunch of different roles (but no public/guest role). Add a new role and you have to sweep through granting permissions, ugh what a pain.
thumbnail
Jeffrey Paul Handa, modificado hace 9 años.

RE: Hide content from authenticated users? (Respuesta)

Liferay Master Mensajes: 541 Fecha de incorporación: 1/12/08 Mensajes recientes
Hi Nels,

Take a look at the permissions.check.guest.enabled property.

However, as David pointed out, this may mean a lot more work in the long run.
Nels Lindquist, modificado hace 9 años.

RE: Hide content from authenticated users?

New Member Mensajes: 2 Fecha de incorporación: 26/03/15 Mensajes recientes
The permissions.check.guest.enabled property was exactly what we needed!

However, as David pointed out, this may mean a lot more work in the long run.


For our use case nearly all content requires authenticated membership to view anyway. There was exactly one Web Content Display portlet I had to add Site Member View permissions to, and everything is now working exactly as we need.

Thanks for your help!