Fórum

portlet access control by user role

shahab mahtab, modificado 12 Anos atrás.

portlet access control by user role

New Member Postagens: 5 Data de Entrada: 13/12/11 Postagens Recentes
Hi:

I would like to grant access to a portlet ("add to page" and "view") based on few custom roles only, which are imported from LDAP.
I have defined the roles in portlet.xml and liferay-portlet.xml of the portlet.

However, it looks like any user can view the portlet. What is the correct way to enforce it?

I have tried adding the permission file (resource-actions\....xml). I can restrict guests from viewing the portlet this way. But, it looks like "resource-action-mapping" DTD does not support custom roles.

Is there a way to enfore role based access control without using the built-in Permissions GUI?

Thanks.
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: portlet access control by user role

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Sure...

Drop the portlet on the page, go to the configuration page for the portlet, to the permissions tab, and set the permissions there. Disable guest perms on the portlet, and you should be golden...
shahab mahtab, modificado 12 Anos atrás.

RE: portlet access control by user role

New Member Postagens: 5 Data de Entrada: 13/12/11 Postagens Recentes
Hi:

Can I configure it from any configuration file other than the "Permissions" tab?

Thanks
thumbnail
Mauro Almeida, modificado 11 Anos atrás.

RE: portlet access control by user role

Junior Member Postagens: 32 Data de Entrada: 15/03/12 Postagens Recentes
Hi Shahab.

Did you manage to overcome this?

Best regards,
MJA
thumbnail
Thomas Berg, modificado 11 Anos atrás.

RE: portlet access control by user role

Regular Member Postagens: 131 Data de Entrada: 07/09/09 Postagens Recentes
Hello Shahab,
You should be able to achieve what you need by reading the information in this thread

HTH

Regards / Thomas
shahab mahtab, modificado 11 Anos atrás.

RE: portlet access control by user role

New Member Postagens: 5 Data de Entrada: 13/12/11 Postagens Recentes
Hi HTH,

I believe, resource-action-mapping takes some pre-defined roles only (guest, community etc.). I ended up writing a filter to checks user's role, and show appropriate message if user is not authorized.

My use case is slightly different. Users are accessing some pre-configured pages with bunch of portlets, and they can view portlets that they are entitled to. (users' entitlement can change dynamically)

Thanks
Shahab
Pablo Martin, modificado 9 Anos atrás.

RE: portlet access control by user role

New Member Postagens: 5 Data de Entrada: 20/01/15 Postagens Recentes
Hi,

I have 2 instances on my liferay
and some portlets deployment and list of portlets in dockbar on adding cannot be seen to another neither the administrator of the another instance.

create a hook to some .jsp is it good ?
How i suppose to do that?

Regards,
Pablo M.