掲示板
Liferay API - Delete users from a group
7年前 に Neil Tran によって更新されました。
Liferay API - Delete users from a group
New Member 投稿: 8 参加年月日: 16/02/15 最新の投稿
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
7年前 に Devang Patel によって更新されました。
RE: Liferay API - Delete users from a group (回答)
Regular Member 投稿: 247 参加年月日: 15/01/19 最新の投稿
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
6年前 に Neil Tran によって更新されました。
RE: Liferay API - Delete users from a group
New Member 投稿: 8 参加年月日: 16/02/15 最新の投稿
Thanks Devang