Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Chandrasekhar Kothuri
How to get the Role based on type in liferay 5.1.2
June 1, 2011 2:32 AM
Answer

Chandrasekhar Kothuri

Rank: Regular Member

Posts: 149

Join Date: July 6, 2009

Recent Posts

Hi All,

I want to get the role based on the type column in the liferay 5.1.2

My Scenario:
-----------------

I created the custom roles in liferay by using role tab from Enterprise_Admin portlet. Now I want to get the roles created by me. I used the following method to get the roles from Role table.

1List<Role> rolesList = RoleUtil.findAll();


I am getting the all roles from role table but I want to get only the roles created by me.

Thanks in advance.

Regards,
Chandrasekhar
Ankit Pancholi
RE: How to get the Role based on type in liferay 5.1.2
June 1, 2011 2:37 AM
Answer

Ankit Pancholi

Rank: Junior Member

Posts: 65

Join Date: January 7, 2010

Recent Posts

Hi,

Try this RoleLocalServiceUtil.getUserRoles(userId);

Hope it works.

Thanks,
AP
Thiago Leão Moreira
RE: How to get the Role based on type in liferay 5.1.2
June 1, 2011 7:20 AM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1388

Join Date: October 10, 2007

Recent Posts

The class has RoleLocalServiceUtil has several methods that can help you to find you roles. I would recommend you to use the search method.