Skip to content

Commit

Permalink
Prevent access errors related to res.groups when saving a user (Numig…
Browse files Browse the repository at this point in the history
  • Loading branch information
ddufresne authored and majouda committed Jul 29, 2024
1 parent dcdeccc commit 4a57166
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin_light_user/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'data.xml',
'mask_admin_groups.xml',
'security/ir.model.access.csv',
'security/extended_security_rule.xml',
],
'installable': True,
}
19 changes: 19 additions & 0 deletions admin_light_user/security/extended_security_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<!--
The ir.model.access.csv file contains an entry to allow editing a user group.
This entry is only there to prevent access errors when creating/updating a user.
Groups should not be editable by the admin light user.
Only real administration groups should have access.
-->
<record id="res_groups_rule" model="extended.security.rule">
<field name="model_id" ref="base.model_res_groups"/>
<field name="groups_id" eval="[(4, ref('base.group_system'))]"/>
<field name="perm_write" eval="1"/>
<field name="perm_create" eval="1"/>
<field name="perm_unlink" eval="1"/>
</record>

</odoo>
2 changes: 1 addition & 1 deletion admin_light_user/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_groups,Admin Light: res.groups,base.model_res_groups,group_user_management,1,0,0,0
access_groups,Admin Light: res.groups,base.model_res_groups,group_user_management,1,1,0,0
access_ir_model_access,Admin Light: ir.model.access,base.model_ir_model_access,group_user_management,1,0,0,0
access_ir_module_category,Admin Light: ir.module.category,base.model_ir_module_category,group_user_management,1,0,0,0
access_ir_rule,Admin Light: ir.rule,base.model_ir_rule,group_user_management,1,0,0,0
Expand Down

0 comments on commit 4a57166

Please sign in to comment.