문제

I'm looking for a way to add an usergroup to a role. I couldn't find a solution in the API or liferay forum. Is something like that possible for usergroups?

GroupLocalServiceUtil.addRoleGroups(portalrole.getRoleId(), grouplist);

It only works for groups. RoleLocalServiceUtil, UserGroupLocalServiceUtil and so on don't have some methods like this.

environment: Liferay. 5.2.3

도움이 되었습니까?

해결책

try in this way

UserGroup ug = UserGroupLocalServiceUtil.getUserGroup(PortalUtil.getCompanyId(request), "your_user_group_name");

long [] ugIds = {ug.getGroup().getGroupId()};

GroupLocalServiceUtil.addRoleGroups(yourRoleId, ugIds );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top