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 ?

有帮助吗?

解决方案

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()});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top