Foros de discusión

Redirect to Login Portlet if User not logged in

Antonino Sirchia, modificado hace 9 años.

Redirect to Login Portlet if User not logged in

New Member Mensajes: 18 Fecha de incorporación: 11/12/14 Mensajes recientes
Hi all.
I need to make private some pages of my public portlet.
How can I do this?
Actually it's sufficient setting a redirect to the default login portlet if a not logged in user try to access such pages.

Is there some magic liferay keyword that can help me?
Thank you.
thumbnail
Pankaj Kathiriya, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in

Liferay Master Mensajes: 722 Fecha de incorporación: 5/08/10 Mensajes recientes
AFAIK, if you try to access Private pages with Guest user, you will be redirected to login portlet.
thumbnail
Miroslav Ligas, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in

Regular Member Mensajes: 152 Fecha de incorporación: 29/07/14 Mensajes recientes
Can't you just move the privet content to privet pages? What's the reason that you us public pages for sensitive data? It makes more sense to have private pages and make some pages public then the other way around.
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
Go to Page Administration, choose the page you're intending to change and set the permissions for the page. The button is labelled "Permissions"
Antonino Sirchia, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in

New Member Mensajes: 18 Fecha de incorporación: 11/12/14 Mensajes recientes
I'm sorry,
my question is wrong!
I need to make private some VIEWS (not pages) of my public portlet...
Is there a way to make private some views and public some other?
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in (Respuesta)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Sure, you can wrap your display code in a permission check. If the user has the permission, show the private data, otherwise do not.
thumbnail
Miroslav Ligas, modificado hace 9 años.

RE: Redirect to Login Portlet if User not logged in

Regular Member Mensajes: 152 Fecha de incorporación: 29/07/14 Mensajes recientes
Yes, as David said you can use the Liferay permission mechanism in your own portlets. Have a look at these links for a way how to implement it in your plugins.
security and permissions liferay portal 6.2 dev guide

samle-permissions-portlet