Filtering user list based on custom fields in the profile

Hey guys, amazing app!

I want to implement the following use case and want to understand how should i go about it - I was going to add custom fields for storing department information.

Our organisation has 2 departments. I want to do two things:

  1. When admin from dept 1 want to create a private channel, they should only be able to see users from dept 1.
  2. When any user from dept 1 wants to DM (private message) to another user, they are only able to do so with dept 1 (the user list should only see org 1 users).

Will really appreciate help here, thanks alot