Question

I'm currently working with Liferay 6.1.1, and i'm coding a hook for default values.

Im desperatly looking for a way to assign userGroup to a Role via the API.

Can someone help ?

Was it helpful?

Solution

I have not tried it but can you do something like this

//Get group from UserGroup
Group group = userGroup.getGroup();
//Assign it to the role
GroupLocalServiceUtil.addRoleGroups(roleId, new long[]{group.getGroupId()});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top