Fórum

Remove Portlet Programmatically - Permissions problems?

Marco Lalla, modificado 8 Anos atrás.

Remove Portlet Programmatically - Permissions problems?

Junior Member Postagens: 25 Data de Entrada: 19/11/09 Postagens Recentes
Request:
Any users may add and remove (from their private home page) some web content display portlets - programmatically - from a custom portlet.
The code is ok, Administrator can add and remove portlets.

PortletID= 56 (Web Content Viewer)
Liferay: 6.1.2-ga3

Permissions:
Web Content Display: View
Web Content Display: Add to page

When I try to execute the same code with any other user: I can add portlet but I cannot remove it.

The only way to remove portlet from private home page (I've found) is: give the permission "update page" to the user (role), but in this case the user can remove all portlet from page and can move any portlet in the page layout (it's not requested).

I haven't exceptions when I execute the code (with a non admin user) to remove the portlets from page.

It's strange: the user can add the portlet but cannot remove it... But the user it's the owner of the page (home private page)..

Ideas?
thumbnail
Denis Signoretto, modificado 8 Anos atrás.

RE: Remove Portlet Programmatically - Permissions problems?

Expert Postagens: 375 Data de Entrada: 21/04/09 Postagens Recentes
Have you already considered to leverage Page Customization Settings ?
Marco Lalla, modificado 8 Anos atrás.

RE: Remove Portlet Programmatically - Permissions problems?

Junior Member Postagens: 25 Data de Entrada: 19/11/09 Postagens Recentes
Hi Denis
thank you for the reply!

I considered this possibility (I'm on LR 6.1), and the functionality "customization" is perfect to achieve my goals, but I have to develop custom solution to add/remove portlets from a specific page "user home page", from another page "user admin page".

A workaround is give update permission to any user and hide/remove programmatically "Drop zone and portlet menu" from "user home page".

But I've another problem, this page "user home page" is associated to a site template and when the user add/remove portlet, the page may lose the propagation changes from the site template...
thumbnail
Denis Signoretto, modificado 8 Anos atrás.

RE: Remove Portlet Programmatically - Permissions problems?

Expert Postagens: 375 Data de Entrada: 21/04/09 Postagens Recentes
A solution could be adding a custom portlet in the user template page that includes programmatically other portlets, e.g. using

<liferay-portlet:runtime portletname="<portlet-id>"></liferay-portlet:runtime>
Marco Lalla, modificado 8 Anos atrás.

RE: Remove Portlet Programmatically - Permissions problems?

Junior Member Postagens: 25 Data de Entrada: 19/11/09 Postagens Recentes
Cool!

I'm trying

Many thanks