Foros de discusión

Roles for an user group

Geetha Raj, modificado hace 14 años.

Roles for an user group

Junior Member Mensajes: 28 Fecha de incorporación: 22/05/08 Mensajes recientes
Is there any way to determine the roles for a user group? Any help is appreciated.

Thanks
thumbnail
Jonas Yuan, modificado hace 14 años.

RE: Roles for an user group

Liferay Master Mensajes: 993 Fecha de incorporación: 27/04/07 Mensajes recientes
HI Geetha,

You can do it simply in Control Panel (UI):

assign a user group as a member of a role.

or check members, the user group should be a member of the role.

Hope that is helps,

Thanks

Jonas Yuan
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
Geetha Raj, modificado hace 14 años.

RE: Roles for an user group

Junior Member Mensajes: 28 Fecha de incorporación: 22/05/08 Mensajes recientes
Thanks for your help, Jonas. I think I should have clarified that I need to determine it programmactically.
thumbnail
Jonas Yuan, modificado hace 14 años.

RE: Roles for an user group

Liferay Master Mensajes: 993 Fecha de incorporación: 27/04/07 Mensajes recientes
Hi Geetha,

No problem. You can use UserGroupRoleLocalServiceUtil, like


        public static boolean hasUserGroupRole(long userId, long groupId,
		java.lang.String roleName)
		throws com.liferay.portal.PortalException,
			com.liferay.portal.SystemException {
		return getService().hasUserGroupRole(userId, groupId, roleName);
	}


or

	public static java.util.List<com.liferay.portal.model.usergrouprole> getUserGroupRoles(
		int start, int end) throws com.liferay.portal.SystemException {
		return getService().getUserGroupRoles(start, end);
	}
</com.liferay.portal.model.usergrouprole>


Hope that it helps.

Jonas Yuan
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
Geetha Raj, modificado hace 14 años.

RE: Roles for an user group

Junior Member Mensajes: 28 Fecha de incorporación: 22/05/08 Mensajes recientes
When I assign a user group as a member of a role, it puts an entry in the table group_roles. Using UserGroupLocalServiceUtil, I am unable to programmactically get back the role. I tried the method getGroupRole from GroupLocalServiceUtil but that doesn't work either. Please let me know if you have any other suggestions or thoughts.
thumbnail
Auditya manikanta Vadrevu, modificado hace 14 años.

RE: Roles for an user group

Liferay Master Mensajes: 621 Fecha de incorporación: 6/05/08 Mensajes recientes
hi geetha,


static Role getGroupRole(java.lang.String companyId, java.lang.String groupId)
, it is in RoleLocalServiceUtil , not in GroupLocalService.


With Regards,
V.Auditya