Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Subhash Pavuskar
Portlet Visibility
April 16, 2012 9:56 PM
Answer

Subhash Pavuskar

Rank: Regular Member

Posts: 234

Join Date: March 12, 2012

Recent Posts

There is a requirement from the client that out of 4 portlets that you have written only 2 should be visible to a particular category of users. How will i have to achieve that? What if some fields in the remaining 2 portlets have also to be controlled based on user role?
David H Nebinger
RE: Portlet Visibility
April 17, 2012 8:04 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11087

Join Date: September 1, 2006

Recent Posts

Seriously I think we covered this before. I know I answered another post that was worded almost identically...

You will create a custom role. The custom role is given privileges to view all 4 portlets where regular guest/user/whatever does not.
Hitoshi Ozawa
RE: Portlet Visibility
April 27, 2012 10:05 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

What if some fields in the remaining 2 portlets have also to be controlled based on user role?


Just use RoleLocalServiceUtil.hasRole() to check the user has a role.