Foren
Liferay API - Delete users from a group
Neil Tran, geändert vor 7 Jahren.
Liferay API - Delete users from a group
New Member Beiträge: 8 Beitrittsdatum: 15.02.16 Neueste Beiträge
Hi all,
I find the Liferay API confusing. There are so many methods that look similar to one and another. The API is not documented properly.
For instance, if I like to remove the users from the group. This code will work
//work
List<User> users = UserLocalServiceUtil.getUserGroupUsers(group.getUserGroupId() );
UserLocalServiceUtil.deleteUserGroupUsers(group.getUserGroupId(),users) ;
Is it simplier, NOT to search for users.
But to remove ALL the users from the group straight away.
Is there a method that allows you to do that?
What does this method do?
//UserGroupLocalServiceUtil.clearGroupUserGroups(group.getUserGroupId()) ;
Thanks
I find the Liferay API confusing. There are so many methods that look similar to one and another. The API is not documented properly.
For instance, if I like to remove the users from the group. This code will work
//work
List<User> users = UserLocalServiceUtil.getUserGroupUsers(group.getUserGroupId() );
UserLocalServiceUtil.deleteUserGroupUsers(group.getUserGroupId(),users) ;
Is it simplier, NOT to search for users.
But to remove ALL the users from the group straight away.
Is there a method that allows you to do that?
What does this method do?
//UserGroupLocalServiceUtil.clearGroupUserGroups(group.getUserGroupId()) ;
Thanks
Devang Patel, geändert vor 7 Jahren.
RE: Liferay API - Delete users from a group (Antwort)
Regular Member Beiträge: 247 Beitrittsdatum: 19.01.15 Neueste Beiträge
Hi Neil Tran,
You can use below code
This below method will clear UserGroups from Group.
Regards,
Devang
You can use below code
UserLocalServiceUtil.deleteGroupUsers(group.getUserGroupId(),users)
This below method will clear UserGroups from Group.
UserGroupLocalServiceUtil.clearGroupUserGroups(group.getUserGroupId()) ;
Regards,
Devang
Neil Tran, geändert vor 6 Jahren.
RE: Liferay API - Delete users from a group
New Member Beiträge: 8 Beitrittsdatum: 15.02.16 Neueste Beiträge
Thanks Devang