Control Contacts displayed by Department

I’m trying to control the display of Contacts to make them specific to each department. So that one user has access to just the contacts of that department. I’ve tested the control that is available that displays just the departments for a user permissions to just the one company, so I want to be able to enter the department for the contact and have the display changed accordingly. At present the contacts just shows the existing ID for the contacts. How should I try and solve this? Thanks in advance.

You can use User Permissions and add Department on your contact doctype as a link field.

Thanks Pawan for the quick response. So I add it as duplicated field as a hidden linkfield? Does it need to have any specific attributes apart from that?

Department may or may not be hidden based on your business needs. Apart from that you can try and post if you run into any issues.