掲示板

Organization Administrator

12年前 に mehmet tasar によって更新されました。

Organization Administrator

Junior Member 投稿: 49 参加年月日: 11/03/06 最新の投稿
Hello everyone,

How can i get all Organization Administrator of one organization.
Which method should I use?
thanks.
thumbnail
12年前 に Mayur Patel によって更新されました。

RE: Organization Administrator

Expert 投稿: 358 参加年月日: 10/11/17 最新の投稿
If you are looking for all users with a given role within a given community:

long companyId= _X_; //Perhaps CompanyThreadLocal.getCompanyId() if you don't have it anywhere else?
Role role=RoleLocalServiceUtil.getRole(companyId, "Example Role"); 
Group group=GroupLocalServiceUtil.getGroup(companyId, "Example Community");
List<usergrouprole> userGroupRoles = UserGroupRoleLocalServiceUtil.
                       getUserGroupRolesByGroupAndRole(groupId, role.getRoleId());
for(UserGroupRole userGroupRole:userGroupRoles){
    User oneUser=userGroupRole.getUser();
}</usergrouprole>


you can make use of Utility methods also,
Role role=RoleLocalServiceUtil.getRole(companyId,[b]RoleConstants.ORGANIZATION_ADMINISTRATOR[/b]);
List<user> UserLocalServiceUtil.getRoleUsers(role.getRoleId())</user>


Remember that the methods in the classes XXXLocalServiceUtil are not checking the permissions of the current user.

Thanks,
Mayur
12年前 に mehmet tasar によって更新されました。

RE: Organization Administrator

Junior Member 投稿: 49 参加年月日: 11/03/06 最新の投稿
thank you Mayur.