0
votes

I have created a module with the model Workers. I gave my Employee group right access to the Workers object to be able to read and write. So the user belonging to the Employee group can access every view belonging to the Worker object.

However, I have created two different views/menu items for my Workers object: HR manager and Auditor. I want only one the Employee group to be able to access only the HR manager view and not the Auditor one.

Basically the codes for the menu items for my two views are as follows:

<menuitem action="action_view_HR_Managers" id="menu_HRManager" name="HRManager"></menuitem>
<menuitem action="action_view_Auditors" id="menu_Auditors" name="Auditors"></menuitem>

Can I restrict menu items to groups?

1

1 Answers

0
votes

To show a menu for a specific group just add groups attribte.

 <menuitem..........   groups="first_group, second_group,..."/>

In this way only users belong to the list of group can see this menu.

For groups that are defined in other addon you need to specify the addon name and add dependencie in you manifest file.

      addon_name.group_name