RE: How to get a user list from a Id role ?

Le Mignant Hugo, modified 6 Years ago. New Member Post: 1 Join Date: 1/18/19 Recent Posts

Hello,

 

Actually, I created in Liferay Administration a role, an user, a user group. 
I assigned the user to user group and the user group to the role.

 

In my code, I have the role Id and I would like to find my user from this data (roleId).
The wanted way will be : Role -> User Group -> User if it's possible.

Do you have an idea to solve my problem ?

 

Best regards, 

Le Mignant Hugo

 

 

thumbnail
Amos Fong, modified 6 Years ago. Liferay Legend Posts: 2047 Join Date: 10/7/08 Recent Posts

I think you can get this info with a few calls. I'm not 100% these are the right methods, but it would be something similar to them.

GroupLocalServiceUtil.getRoleGroups(long roleId)

Then with

UserLocalServiceUtil.getGroupUserIds(long groupId)