Filter List View Items

Hi is it possible to make a permission to view document based on the reports_to / department from the employee doctype
Example:-
Emp A is in sales Dept
only other users that on sales dept can view the Emp A data
What are the settings for this scenario?

I use this on employee custom script but to no avail it still show all department

frappe.listview_settings[‘Employee’] = {
onload: function(listview) {
if (!frappe.route_options){
frappe.route_options = {
“department”: ["=", “frappe.session.user.department”]
};
}
}};

Hi,

This can be done using User Permissions. Check this link: https://docs.erpnext.com/docs/user/manual/en/setting-up/users-and-permissions/user-permissions

Hope this helps.