via groups.
Actually, menu definition is as follows
<menuitem id="menu_act_for_warehouse" action="act_for_warehouse" sequence="2" parent="some_parent_id"/>
Where 'act_for_warehouse' is the action id that call a specific view.
You have to define a group for all users in department A, say. You have after that to rewrite the menu definition as follows
<menuitem id="menu_act_for_warehouse" action="act_for_warehouse" sequence="2" parent="some_parent_id" groups="your_module_name.group_for_department_a"/>
This menu will be seen only by the users in the group 'group_for_department_a', and other users won't see it. This is the most trivia solution even it requires double work. I mean, you have to add users to department and add them also to the group that is related to this department.
I think one can invent other solution that avoid double work. Try this first and let us see.
This is totally wrong question. Please double check your question. You can never hide menu depending on data. I think you want to know, how to hide data based on department_id ?
Question is actually correct. How can i hide menu depending on department_id. So if user working on Warehouse is logged in selected menu should appear or disappear. In this case Menu for Warehouse should be displayed. How can I do it then ?