How to control whom users can see and chat with


I need to know if it is possible to assign the group chat for each user so for example,

If I have the following users
When user1 is logged in, he can only see and chat with user2, user3.
When user2 is logged in, he can only see and chat with user1, user4, user5
If there is another approach to this, please guide me through.


It is needed to assign each user to a department, so that you are able to control what users he/she can see and chat with by assign different roles. For example, I've created department for each user: Group1 for user1, Group2 for user2, Group3 for user3...

Create a role for Group1, check Group1, Group2 and Group3 to be accessed. Thus, when login with user1, he can only see user1, user2 and user3.

Create another role for Group2, then check Group1, Group2, Group4, Group5 in Access Control page. Thus, only user1, user2, user4 and user5 will be shown in the contact list when login with user2. See the screenshots below.