Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Dinesh Balaji
How to Restrict portlets based on the roles ?
24 ottobre 2011 5.12

Dinesh Balaji

Punteggio: Junior Member

Messaggi: 52

Data di Iscrizione: 6 ottobre 2010

Messaggi recenti

Dear All,

I have developed a portlet which should be visibile to one particular role.

In Portal-ext I have added this portlet- default.user.private.layout.column-1=quickfind_WAR_QuickFindportlet and this is coming in all private pages.

To restrict the same I tried restricting by liferay-portal.xml where I can given only

and I have chnaged also the portlet.xml also. But still I am not able to restrict the same. Already questions are raised on this but no reply were there -

Kinldy help.

Warm Regards,
Dinesh V
Tomas Polesovsky
RE: How to Restrict portlets based on the roles ?
25 ottobre 2011 2.26

Tomas Polesovsky


Punteggio: Liferay Master

Messaggi: 650

Data di Iscrizione: 13 febbraio 2009

Messaggi recenti


I think there must be bug in the portal. I can define it but just for the first time. This means:
1, I created regular role named Customer
2, In liferay-portlet.xml I defined
1    <role-mapper>
2        <role-name>customer</role-name>
3        <role-link>Customer</role-link>
4    </role-mapper>

3, In portlet.xml I defined
1         <security-role-ref>
2            <role-name>customer</role-name>
3        </security-role-ref>

When I deploy my portlet for the first time, everything works as expected. But for the 2nd time, when I change anything (add another security-role-ref), my changes are not published into DB.

If you can't delete rows in your DB then try to rename your portlet (portlet name or war file name=project name).

I've found LPS-8955 that describes this behaviour.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!