Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dinesh Balaji
How to Restrict portlets based on the roles ?
October 24, 2011 5:12 AM
Answer

Dinesh Balaji

Rank: Junior Member

Posts: 52

Join Date: October 6, 2010

Recent Posts

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
<role-mapper>
<role-name>customer</role-name>
<role-link>Customer</role-link>
</role-mapper>

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 - http://www.liferay.com/community/forums/-/message_boards/message/8338186

Kinldy help.

Warm Regards,
Dinesh V
Tomas Polesovsky
RE: How to Restrict portlets based on the roles ?
October 25, 2011 2:26 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 586

Join Date: February 13, 2009

Recent Posts

Dinesh,

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.